NAV Navbar
javascript typescript
  • Drone Charging Protocol
  • Need
  • Need filter
  • Bid
  • Starting
  • Request Status
  • Provider Status
  • Drone Status
  • Charging Arrival
  • Charging Started
  • Charging Complete
  • Plug Types
  • Energy Sources
  • Drone Protection Level
  • Amenities
  • Price Types
  • Drone Charging

    Drone Charging Protocol

    The communication protocol for drone charging describes the format of a request for a charging service (need), and the response sent by a charging provider (bid).

    For example, a drone might search for charging stations within 2 km of its location that supports 2mm bullet connectors.

    In response, a charging station might send back a bid with a price per kWh, a time at which the service can be provided, and additional amenities provided (e.g., the ability for the drone to remain parked on the charger after charging completes).

    Need

    A statement of need for charging services. Typically this will be sent by a drone that is looking for a charging station around certain coordinates.

    This request is sent to the discovery engine which broadcasts the need to DAV identities that can provide this service. Bids are later received in response.

    Arguments

    const { SDKFactory } = require("dav-js");
    const { NeedParams, enums } = require("dav-js/dist/drone-charging");
    const DAV = SDKFactory({
      apiSeedUrls,
      kafkaSeedUrls
    });
    const drone = await DAV.getIdentity(droneDavId);
    
    const needParams = new NeedParams({
      location: {
        lat: 32.050382,
        long: 34.766149
      },
      radius: 20,
      startAt: 1538995253092,
      dimensions: {
        length: 50,
        width: 15,
        height: 20
      },
      plugTypes: [enums.PlugTypes.Bullet2mm],
      weight: 50000,
      batteryCapacity: 4,
      currentBatteryCharge: 45,
      energySource: enums.EnergySources.Solar,
      amenities: [enums.Amenities.Docking]
    });
    const need = await drone.publishNeed(needParams);
    
    import { SDKFactory } from "dav-js";
    import { NeedParams, enums } from "dav-js/dist/drone-charging";
    const DAV = SDKFactory({
      apiSeedUrls,
      kafkaSeedUrls
    });
    const drone = await DAV.getIdentity(droneDavId);
    
    const needParams = new NeedParams({
      location: {
        lat: 32.050382,
        long: 34.766149
      },
      radius: 20,
      startAt: 1538995253092,
      dimensions: {
        length: 50,
        width: 15,
        height: 20
      },
      plugTypes: [enums.PlugTypes.Bullet2mm],
      weight: 50000,
      batteryCapacity: 4,
      currentBatteryCharge: 45,
      energySource: enums.EnergySources.Solar,
      amenities: [enums.Amenities.Docking]
    });
    const need = await drone.publishNeed(needParams);
    
    location
    required
    The coordinates around which to search
    radius
    required
    Radius in meters around the coordinates in which to search for charging services. Specified as an integer
    droneType
    optional
    The manufacturer and/or the model number of the drone. An unformatted string
    plugTypes
    required
    The drone's plug type ID. See Plug Types for possible values
    chargePadType
    optional
    The type of charging pad. Accepted values can be either open (for an unprotected pad) or enclosed (for an enclosed charging pad)
    droneProtectionLevel
    optional
    Charging stations may also provide protection services for drones. This parameter specifies the level of protection given to a drone. See possible codes under Drone Protection Level
    startAt
    optional
    The time at which the requester would like to arrive at charger (if undefined, the arrival time will be ASAP). Specified as time in seconds since Epoch/Unix Time
    dimensions
    optional
    The minimum length, width, and height clearance that this drone requires from the charger. Specified as an object containing integers representing centimeters
    weight
    optional
    The weight of this drone. Specified as an integer representing grams
    batteryCapacity
    optional
    The drone's total battery capacity, specified in kWh
    currentBatteryCharge
    optional
    The drone's current battery charge level, as it was at the time the request was sent. Specified as an integer denoting percentage of full capacity
    energySource
    optional
    Limit the request to only receive bids from chargers using a specific source of energy. Specified as an energy source id. See Energy Sources
    amenities
    optional
    A list of amenities that need to be present at charging station. Specified as an array of amenity ids. See Amenities

    Need filter

    Begin listening for incoming needs that match certain requirements. Typically this will be a charging station subscribing to incoming needs from drones.

    Arguments

    const { SDKFactory } = require("dav-js");
    const { NeedFilterParams } = require("dav-js/dist/drone-charging");
    const DAV = SDKFactory({
      apiSeedUrls,
      kafkaSeedUrls
    });
    const charger = await DAV.getIdentity(chargerDavId);
    
    const needFilterParams = new NeedFilterParams({
      location: {
        lat: 32.050382,
        long: 34.766149
      },
      radius: 1000,
      maxDimensions: {
        length: 120,
        width: 80,
        height: 100
      }
    });
    const needs = await charger.needsForType(needFilterParams);
    
    import { SDKFactory } from "dav-js";
    import { NeedFilterParams } from "dav-js/dist/drone-charging";
    const DAV = SDKFactory({
      apiSeedUrls,
      kafkaSeedUrls
    });
    const charger = await DAV.getIdentity(chargerDavId);
    
    const needFilterParams = new NeedFilterParams({
      location: {
        lat: 32.050382,
        long: 34.766149
      },
      radius: 1000,
      maxDimensions: {
        length: 120,
        width: 80,
        height: 100
      }
    });
    const needs = await charger.needsForType(needFilterParams);
    
    location
    required
    The coordinates around which to listen for bids
    radius
    required
    Radius in meters around the coordinates in which to listen for bids. Specified as an integer
    maxDimensions
    optional
    The maximum length, width, and height clearance that this charger can accomodate. Specified as an object containing integers representing centimeters

    Bid

    A bid to provide a charging service. Typically sent from a charger to a drone.

    Arguments

    const { BidParams } = require('dav-js/dist/drone-charging');
    
    needs.subscribe(need => {
      const bidParams = new BidParams({
        ttl: Date.now() + 3600000,
        price: [
          '15000000000000000000',
          { amount: '1000000000000000000', type: 'flat', description: 'Tax' },
        ],
        plugTypes:[enums.PlugTypes.Bullet2mm],
        entranceLocation: {
          lat: 32.050382,
          long: 34.766149,
        },
        exitLocation: {
          lat: 32.050382,
          long: 34.766149,
        },
        locationName: 'IKEA parking lot B'
        locationNameLang: 'eng'
        locationStreet: 'King',
        locationHouseNumber: '372',
        locationCity: 'Charleston',
        locationPostalCode: '29401',
        locationCounty: 'Charleston',
        locationState: 'SC',
        locationCountry: 'USA',
        availableFrom: Date.now(),
        availableUntil: Date.now() + 3600000,
        energySource: EnergySources.Hydro,
        amenities: [Amenities.Park],
        provider: 'MegaCharge',
        manufacturer: 'Mega Tech LLC',
        model: 'MegaBolt',
      });
      const bid = await need.createBid(bidParams);
    });
    
    import { BidParams } from 'dav-js/dist/drone-charging';
    
    needs.subscribe((need: Need<NeedParams>) => {
      const bidParams = new BidParams({
        ttl: Date.now() + 3600000,
        price: [
          '15000000000000000000',
          { amount: '1000000000000000000', type: 'flat', description: 'Tax' },
        ],
        plugTypes:[enums.PlugTypes.Bullet2mm],
        entranceLocation: {
          lat: 32.050382,
          long: 34.766149,
        },
        exitLocation: {
          lat: 32.050382,
          long: 34.766149,
        },
        locationName: 'IKEA parking lot B'
        locationNameLang: 'eng'
        locationStreet: 'King',
        locationHouseNumber: '372',
        locationCity: 'Charleston',
        locationPostalCode: '29401',
        locationCounty: 'Charleston',
        locationState: 'SC',
        locationCountry: 'USA',
        availableFrom: Date.now(),
        availableUntil: Date.now() + 3600000,
        energySource: EnergySources.Hydro,
        amenities: [Amenities.Park],
        provider: 'MegaCharge',
        manufacturer: 'Mega Tech LLC',
        model: 'MegaBolt',
      });
      const bid = await need.createBid(bidParams);
    });
    
    ttl
    optional
    This bid will expire at this time. Specified as time in seconds since Epoch/Unix Time
    price
    required
    A single price or an array containing prices. If an array is given, all the prices will be charged (e.g., a price per kWh plus a flat rate tax). Each price is specified as either an string representing Vinci, or a price object containing amount, price type, and an optional description
    1 DAV == 1e18 Vinci == 1000000000000000000 Vinci
    entranceLocation
    optional
    The coordinates of the charger entrance
    exitLocation
    optional
    The coordinates of the exit from to the charger
    locationName
    optional
    A human readable name/description of the charger location (e.g., Cal Maritime Dock C)
    locationNameLang
    optional
    The language used in location_name. Specified using the 3 letter ISO 639-3 language code
    locationHouseNumber
    optional
    The house number where the station is located
    locationStreet
    optional
    The street name where the station is located
    locationCity
    optional
    The city where the station is located
    locationPostalCode
    optional
    The postal code where the station is located
    locationCounty
    optional
    The county where the charger is located
    locationState
    optional
    The state where the charger is located
    locationCountry
    optional
    The country where the charger is located
    availableFrom
    required
    The time from which the charger can be made available for the drone requesting a charge. Specified as time in seconds since Epoch/Unix Time
    availableUntil
    optional
    The time until which the charger can be made available for the drone requesting a charge. Specified as time in seconds since Epoch/Unix Time
    energySource
    optional
    The source of the energy used by this charger. Specified as an energy source id. See Energy Sources
    amenities
    optional
    A list of amenities that are present at this charger. Specified as an array of amenity ids. See Amenities
    plugTypes
    required
    The drone's plug type ID. See Plug Types for possible values
    chargePadType
    optional
    The type of charging pad. Accepted values can be either open (for an outdoor pad) or enclosed (for an enclosed charging pad)
    droneProtectionLevel
    optional
    Charging stations may also provide protection services for drones. This parameter specifies the level of protection given to a drone. See possible codes under Drone Protection Level
    provider
    optional
    Name of the service provider or charging network operating this charger
    manufacturer
    optional
    Name of the manufacturer of this charger
    model
    optional
    Name of the model of this charger

    Starting

    A message sent by the service provider (the charger) to the service requester, notifying it that the mission has started

    Arguments

    const { StartingMessageParams } = require("dav-js/dist/drone-charging");
    
    const startingMessage = new StartingMessageParams();
    mission.sendMessage(startingMessage);
    
    import { StartingMessageParams } from "dav-js/dist/drone-charging";
    
    const startingMessageParams = new StartingMessageParams();
    mission.sendMessage(startingMessage);
    
    None

    Request Status

    A request message sent by either party, asking the other party for a status update

    Arguments

    const { StatusRequestMessageParams } = require("dav-js/dist/drone-charging");
    
    const statusRequestMessage = new StatusRequestMessageParams({});
    mission.sendMessage(statusRequestMessage);
    
    import { StatusRequestMessageParams } from "dav-js/dist/drone-charging";
    
    const statusRequestMessage = new StatusRequestMessageParams({});
    mission.sendMessage(statusRequestMessage);
    
    None

    Provider Status

    A status update sent by the service provider (usually a charging station) to the drone

    Arguments

    const { ProviderStatusMessageParams } = require("dav-js/dist/drone-charging");
    
    const providerStatusMessage = new ProviderStatusMessageParams({
      chargeCompletionEstimatedTime: Date.now() + 5000
    });
    mission.sendMessage(providerStatusMessage);
    
    import { ProviderStatusMessageParams } from "dav-js/dist/drone-charging";
    
    const providerStatusMessage = new ProviderStatusMessageParams({
      chargeCompletionEstimatedTime: Date.now() + 5000
    });
    mission.sendMessage(providerStatusMessage);
    
    chargeCompletionEstimatedTime
    optional
    The estimated time at which charging will be complete. Specified as time in seconds since Epoch/Unix Time

    Drone Status

    A status update sent by the service requester (the drone) to the service provider (charger)

    Arguments

    const { DroneStatusMessageParams } = require("dav-js/dist/drone-charging");
    
    const droneStatusMessage = new DroneStatusMessageParams({
      location: {
        lat: 32.050382,
        long: 34.766149
      }
    });
    mission.sendMessage(droneStatusMessage);
    
    import { DroneStatusMessageParams } from "dav-js/dist/drone-charging";
    
    const droneStatusMessage = new DroneStatusMessageParams({
      location: {
        lat: 32.050382,
        long: 34.766149
      }
    });
    mission.sendMessage(droneStatusMessage);
    
    location
    optional
    The current coordinates of the vehicle's location

    Charging Arrival

    A message sent by the service requester (the drone) to the service provider (charger), notifying it that it has arrived at the charger's location

    Arguments

    const { ChargingArrivalMessageParams } = require("dav-js/dist/drone-charging");
    
    const chargingArrivalMessage = new ChargingArrivalMessageParams();
    mission.sendMessage(chargingArrivalMessage);
    
    import { ChargingArrivalMessageParams } from "dav-js/dist/drone-charging";
    
    const chargingArrivalMessage = new ChargingArrivalMessageParams();
    mission.sendMessage(chargingArrivalMessage);
    
    None

    Charging Started

    A message sent by the service provider to the service requester, notifying it that charging has begun

    Arguments

    import { ChargingStartedMessageParams } from "dav-js/dist/drone-charging";
    
    const chargingStartedMessage = new ChargingStartedMessageParams();
    mission.sendMessage(chargingStartedMessage);
    
    const { ChargingStartedMessageParams } = require("dav-js/dist/drone-charging");
    
    const chargingStartedMessage = new ChargingStartedMessageParams();
    mission.sendMessage(chargingStartedMessage);
    
    None

    Charging Complete

    A message sent by the service provider to the service requester, notifying it that charging has completed

    Arguments

    const { ChargingCompleteMessageParams } = require("dav-js/dist/drone-charging");
    
    const chargingCompleteMessage = new ChargingCompleteMessageParams();
    mission.sendMessage(chargingCompleteMessage);
    
    import { ChargingCompleteMessageParams } from "dav-js/dist/drone-charging";
    
    const chargingCompleteMessage = new ChargingCompleteMessageParams();
    mission.sendMessage(chargingCompleteMessage);
    
    None

    Plug Types

    Below is a list of all the supported drone plug types.

    Plug Type ID Name Amp Tolerance to Plug Type
    jst_739 JST Connector 739 Up to 5 Amps
    bullet_2mm 2mm bullet connectors Up to 20 Amps
    bullet_3_5mm 3.5mm bullet connectors Up to 40 Amps
    xt_60_420 XT60 connectors 420 Up to 60 Amps
    t_plug_204 T-Plug 204 Up to 60 Amps
    ec3_306 EC3 connector 306 Up to 60 Amps
    bullet_4mm 4mm bullet connectors Up to 70 Amps
    ec5_678 EC5 connectors 678 Up to 120 Amps
    bullet_6mm 6mm bullet connectors Up to 120 Amps
    bullet_8mm 8mm bullet connectors Up to 200 Amps

    Energy Sources

    The energy source used by the charging station.

    Source Description
    grid Connected to the electrical grid and using an unspecified energy source, or an unspecified mix of energy source
    renewable Uses 100% renewable energy of an unspecified source, or a mix of different renewable energy sources
    solar Uses 100% solar energy
    wind Uses 100% wind energy
    hydro Uses 100% hydropower energy
    geothermal Uses 100% geothermal energy

    Drone Protection Level

    A charging station may also provide a certain level of protection from solids and/or liquids (mainly water and dust). The following table describes the standard levels of protection according to the International Protection Marking, IEC standard 60529.

    The first digit indicates the level of protection that the enclosure provides against access to hazardous parts (e.g., electrical conductors, moving parts) and the ingress of solid foreign objects.

    The second digit indicates the level of protection that the enclosure provides against harmful ingress of water.

    For a full listing of all available codes, read more about International Protection Marking, IEC standard 60529.

    Rating Code IP Rating Solid Particle Protection Liquid Ingress Protection
    54 IP54 Protected from limited dust ingress Protected from water spray from any direction, limited ingress protection
    55 IP55 Protected from limited dust ingress Protected from low pressure water jets from any direction, limited ingress protection
    56 IP56 Protected from limited dust ingress Protected from high pressure water jets from any direction, limited ingress protection
    57 IP57 Protected from limited dust ingress Protected from immersion between 15 centimeters and 1 meter in depth, limited ingress protection
    58 IP58 Protected from limited dust ingress Protected from long term immersion up to a specified pressure, limited ingress protection
    60 IP60 Protected from total dust ingress Not protected from liquids, limited ingress protection
    61 IP61 Protected from total dust ingress Protected from condensation, limited ingress protection
    62 IP62 Protected from total dust ingress Protected from water spray less than 15 degrees from vertical, limited ingress protection
    63 IP63 Protected from total dust ingress Protected from water spray less than 60 degrees from vertical, limited ingress protection
    64 IP64 Protected from total dust ingress Protected from water spray from any direction, limited ingress protection
    65 IP65 Protected from total dust ingress Protected from low pressure water jets from any direction, limited ingress protection
    66 IP66 Protected from total dust ingress Protected from high pressure water jets from any direction, limited ingress protection
    67 IP67 Protected from total dust ingress Protected from immersion between 15 centimeters and 1 meter in depth, limited ingress protection
    68 IP68 Protected from total dust ingress Protected from long term immersion up to a specified pressure, limited ingress protection
    69k IP69K Protected from total dust ingress Protected from steam-jet cleaning, limited ingress protection

    Amenities

    A list of amenities can be included in both requests and responses.

    ID Description
    1 Parking

    Price Types

    Price types and their unique identifier.

    Price Type Description
    kwh Cost per kWh
    second Cost per second
    minute Cost per minute
    hour Cost per hour
    day Cost per day
    week Cost per week
    flat The listed price is a flat price