Wiki

Clone wiki

RVR CPP / API Table

API Table

This is a table of the API showing the processor, device, command code and its mnemonic, the paramters for the request, and the data in the reponse. If the Request cell is empty there is no data sent. If the Response cell is empty no data is returned but, if there is an error, a code will be returned.

Data Term Definitions

The following defintions apply:

Term Meaning
bool false (0x00) or true (0x01) byte
byte 1 byte unsigned integer
byte array non-character bytes from start of field to end of field
confidence 1 byte unsigned integer indicating leve of confidence in reading
float 2 byte float
milliseconds 2 byte unsigned integer
string characters from start of field to end of field, no end zero delimiter
unsigned integer 2 byte integer

API Table

Processor Device Code Command Request Response Terms
API
btc api_and_shell 0x00 echo byte array byte array
Connection**
nordic connection 0x05 get_bluetooth_advertising_name string
Drive
btc drive 0x01 raw_motors l-mode, l-speed, r-mode, r-speed modes: off(0x0), forward(0x01), reverse(0x02)
btc drive 0x06 reset_yaw
btc drive 0x07 drive_with_heading speed, 2 byte heading, motor flags heading (degress) clockwise, motor flags : reverse(0x00), boost(0x01), fast turn(0x02)
btc drive 0x25 enable_motor_stall_notify bool
btc drive 0x26 motor_stall_notify motor index, triggered motor index:left(0x00), right(0x01)
triggered: bool
btc drive 0x27 enable_motor_fault_notify bool
btc drive 0x28 motor_fault_notify bool
btc drive 0x29 get_motor_fault_state bool
IO (LED)
nordic io_led 0x1A set_all_leds 4 byte LED bit mask 3 byte color for each bit Note 1
nordic io_led 0x44 get_active_color_palette rgb index bytes Note 2
nordic io_led 0x45 set_active_color_palette rgb index bytes index confidence Note 2
nordic io_led 0x46 get_color_identification_report red, green, blue, confidence Note 3
nordic io_led 0x47 load_color_palette pallete index Note 3
nordic io_led 0x48 save_color_palette pallete index Note 3
nordic io_led 0x4E release_led_requests
Power
nordic power 0x00 power off seconds to shutdown Note - complete power off
nordic power 0x01 sleep
nordic power 0x0D wake
nordic power 0x10 get_battery_percentage byte
nordic power 0x11 system_awake_notification
nordic power 0x17 get_battery_voltage_state state flag unknown(0x00), ok(0x01), low(0x02), critical(0x03)
nordic power 0x19 will_sleep_notify
nordic power 0x1A did_sleep_notify
nordic power 0x1B enable_battery_voltage_state_change_notify bool
nordic power 0x1C battery_voltage_state_change_notify notification_data
nordic power 0x25 get_battery_voltage_in_volts reading type 4 byte float calibrated filtered(0x00),calibrated unfiltered(0x01), uncalibrated unfiltered(0x02)
nordic power 0x26 get_battery_voltage_state_thresholds 3 x 4 byte floats critical threshold, low threshold, hysteresis
btc power 0x27 get_current_sense_amplifier_current motor side 4 byte float left(0x00), right(0x01)
Sensors
btc sensors 0x0F enable_gyro_max_notify bool
btc sensors 0x10 gyro_max_notify gyro max flags Note 4
btc sensors 0x13 reset_locator_x_and_y
btc sensors 0x17 set_locator_flags bool false: reset on yaw reset, true: ignore yaw reset
btc sensors 0x22 get_bot_to_bot_infrared_readings byte array
btc sensors 0x23 get_rgbc_sensor 4 x unsigned integer red, gree, blue, clear
btc sensors 0x27 start_robot_to_robot_infrared_broadcasting
btc sensors 0x28 start_robot_to_robot_infrared_following
btc sensors 0x29 stop_robot_to_robot_infrared_broadcasting bool
btc sensors 0x2C robot_to_robot_infrared_message_received_notify notification_data
nordic sensors 0x30 get_ambient_light_sensor_value 4 byte float
btc sensors 0x32 stop_robot_to_robot_infrared_following
btc sensors 0x33 start_robot_to_robot_infrared_evading
btc sensors 0x34 stop_robot_to_robot_infrared_evading
nordic sensors 0x35 enable_color_detection_notify bool, milliseconds, confidence
nordic sensors 0x36 color_detection_notify 5 x byte red, green, blue, confidence, classification
nordic sensors 0x37 get_current_detected_color_reading color_detection_notify semt in response
nordic sensors 0x38 enable_color_detection bool
btc sensors 0x39 configure_streaming_service See Streaming
nordic sensors 0x39 configure_streaming_service See Streaming
btc sensors 0x3A start_streaming_service milliseconds See Streaming
nordic sensors 0x3A start_streaming_service milliseconds See Streaming
btc sensors 0x3B stop_streaming_service See Streaming
nordic sensors 0x3B stop_streaming_service See Streaming
btc sensors 0x3C clear_streaming_service See Streaming
nordic sensors 0x3C clear_streaming_service See Streaming
btc sensors 0x3D streaming_service_data_notify token, sensor data See Streaming
nordic sensors 0x3D streaming_service_data_notify token, sensor data See Streaming
btc sensors 0x3E enable_robot_infrared_message_notify bool
btc sensors 0x3F send_infrared_message byte array
btc sensors 0x4A motor_temperature byte array of codes 4 byte float for each code Note 5
btc sensors 0x4B get_motor_thermal_protection_status float l motor temp
status Ok (0x00), warn(0x01), critical(0x02)
float l motor temp
status Ok (0x00), warn(0x01), critical(0x02)
btc sensors 0x4C enable_motor_thermal_protection_status_notify bool
btc sensors 0x4D motor_thermal_protection_status_notify float l motor temp
l status Ok (0x00), warn(0x01), critical(0x02)
float r motor temp
r status Ok (0x00), warn(0x01), critical(0x02)
System
btc system 0x00 bt_main_application_version 3 x unsigned integer major, minor, revision
nordic system 0x00 noridic_main_application_version 3 x unsigned integer major, minor, revision
btc system 0x01 bt_bootloader_version 3 x unsigned integer major, minor, revision
nordic system 0x01 bt_bootloader_version 3 x unsigned integer major, minor, revision
nordic system 0x03 board_revision byte
nordic system 0x06 mac_address string
nordic system 0x13 stats_id byte
btc system 0x1F bt_processor_name string
nordic system 0x1F nordic_processor_name string
nordic system 0x38 get_sku string "RVR"
btc system 0x39 get_core_up_time_in_milliseconds 8 byte unsigned integer

Note 1: Set All LEDs

Note 2: RGB

Note 3: Color Palletes

Note 4: Gyro Max Flags Max Plus X: bit 0 Max Minus X: bit 1 Max Plus Y: bit 2 Max Minus Y: bit 3 Max Plus Z: bit 4 Max Minus Z: bit 5

Note 5: Motor Temperature:

Updated