ble.error

Many functions provide status and error information, either returning BLE_SUCCESS or BLE_CHECK_ERROR, in which case the variable ble.error can be checked for the specific error. This is done for consistency because not all error-causing events return directly to the main sketch. Functions used to get data may set ble.error even though they are not able to return BLE_SUCCESS or BLE_CHECK_ERROR. The possible errors are listed here:

  • 0x00: BLE_SUCCESS

  • 0x83: BLE_FAILURE

  • 0x84: BLE_INVALID_PARAMETERS

  • 0x8A: BLE_ALREADY_ADVERTISING

  • 0x8B: BLE_NOT_ADVERTISING

  • 0x92: BLE_NOT_CONNECTED

  • 0x50: BLE_INVALID_HANDLE

  • 0x51: BLE_UNDEFINED_VALUE

  • 0x52: BLE_NOT_IMPLEMENTED

  • 0x53: BLE_TIMEOUT

  • 0x54: BLE_CHECK_ERROR

If the offending function encapsulates many commands (e.g. HCI commands), the user can check ble.opcode for the specific command parameter. This is not set by most functions.

Guide Home