Documentation
¶
Index ¶
- Constants
- func AddGATTSCharacteristic(service_handle uint16, char_md *GATTSCharMd, attr_char_value *GATTSAttr, ...) uint32
- func AddGATTSDescriptor(char_handle uint16, attr *GATTSAttr, handle *uint16) uint32
- func AddGATTSInclude(service_handle uint16, inc_srvc_handle uint16, include_handle *uint16) uint32
- func AddGATTSService(typ uint8, uuid *UUID, handle *uint16) uint32
- func AddUUIDVS(vs_uuid *UUID128, uuid_type *uint8) uint32
- func AuthenticateGAP(conn_handle uint16, sec_params *GAPSecParams) uint32
- func CancelGAPConnect() uint32
- func ChangedGATTSService(conn_handle uint16, start_handle uint16, end_handle uint16) uint32
- func ConfigureGAPAdvSet(adv_handle *uint8, adv_data *GAPAdvData, adv_params *GAPAdvParams) uint32
- func ConfirmGATTCHv(conn_handle uint16, handle uint16) uint32
- func ConnectGAP(peer_addr *GAPAddr, scan_params *GAPScanParams, conn_params *GAPConnParams, ...) uint32
- func ControlL2capChFlow(conn_handle uint16, local_cid uint16, credits uint16, credits *uint16) uint32
- func DecodeUUID(uuid_le_len uint8, uuid_le *uint8, uuid *UUID) uint32
- func DisconnectGAP(conn_handle uint16, hci_status_code uint8) uint32
- func DiscoverGATTCAttrInfo(conn_handle uint16, handle_range *GATTCHandleRange) uint32
- func DiscoverGATTCCharacteristics(conn_handle uint16, handle_range *GATTCHandleRange) uint32
- func DiscoverGATTCDescriptors(conn_handle uint16, handle_range *GATTCHandleRange) uint32
- func DiscoverGATTCPrimaryServices(conn_handle uint16, start_handle uint16, srvc_uuid *UUID) uint32
- func DiscoverGATTCRelationships(conn_handle uint16, handle_range *GATTCHandleRange) uint32
- func Enable(app_ram_base *uint32) uint32
- func EncodeUUID(uuid *UUID, uuid_le_len *uint8, uuid_le *uint8) uint32
- func EncryptGAP(conn_handle uint16, master_id *GAPMasterId, enc_info *GAPEncInfo) uint32
- func GetEvt(dest *uint8, len *uint16) uint32
- func GetGAPAddr(addr *GAPAddr) uint32
- func GetGAPAdvAddr(adv_handle uint8, addr *GAPAddr) uint32
- func GetGAPAppearance(appearance *uint16) uint32
- func GetGAPConnSec(conn_handle uint16, conn_sec *GAPConnSec) uint32
- func GetGAPDeviceName(dev_name *uint8, len *uint16) uint32
- func GetGAPLescOobData(conn_handle uint16, pk_own *GAPLescP256Pk, oobd_own *GAPLescOobData) uint32
- func GetGAPNextConnEvtCounter(conn_handle uint16, counter *uint16) uint32
- func GetGAPPpcp(conn_params *GAPConnParams) uint32
- func GetGAPPrivacy(privacy_params *GAPPrivacyParams) uint32
- func GetGAPRssi(conn_handle uint16, rssi *int8, ch_index *uint8) uint32
- func GetGATTSAttr(handle uint16, uuid *UUID, md *GATTSAttrMd) uint32
- func GetGATTSInitialUserHandle(handle *uint16) uint32
- func GetGATTSSysAttr(conn_handle uint16, sys_attr_data *uint8, len *uint16, flags uint32) uint32
- func GetGATTSValue(conn_handle uint16, handle uint16, value *GATTSValue) uint32
- func GetOpt(opt_id uint32, opt *Opt) uint32
- func GetVersion(version *Version) uint32
- func HvxGATTS(conn_handle uint16, hvx_params *GATTSHvxParams) uint32
- func NotifyGAPKeypress(conn_handle uint16, kp_not uint8) uint32
- func ReadGATTC(conn_handle uint16, handle uint16, offset uint16) uint32
- func ReadGATTCCharValueByUUID(conn_handle uint16, uuid *UUID, handle_range *GATTCHandleRange) uint32
- func ReadGATTCCharValues(conn_handle uint16, handles *uint16, handle_count uint16) uint32
- func ReleaseL2capCh(conn_handle uint16, local_cid uint16) uint32
- func RemoveUUIDVS(uuid_type *uint8) uint32
- func ReplyGAPAuthKey(conn_handle uint16, key_type uint8, key *uint8) uint32
- func ReplyGAPLescDhkey(conn_handle uint16, dhkey *GAPLescDhkey) uint32
- func ReplyGAPSecInfo(conn_handle uint16, enc_info *GAPEncInfo, id_info *GAPIrk, ...) uint32
- func ReplyGAPSecParams(conn_handle uint16, sec_status uint8, sec_params *GAPSecParams, ...) uint32
- func ReplyGATTSExchangeMtu(conn_handle uint16, server_rx_mtu uint16) uint32
- func ReplyGATTSRwAuthorize(conn_handle uint16, rw_authorize_reply_params *GATTSRwAuthorizeReplyParams) uint32
- func ReplyUserMem(conn_handle uint16, block *UserMemBlock) uint32
- func RequestGATTCExchangeMtu(conn_handle uint16, client_rx_mtu uint16) uint32
- func RxL2capCh(conn_handle uint16, local_cid uint16, sdu_buf *Data) uint32
- func SetCfg(cfg_id uint32, cfg *Cfg, app_ram_base uint32) uint32
- func SetGAPAddr(addr *GAPAddr) uint32
- func SetGAPAppearance(appearance uint16) uint32
- func SetGAPDeviceIdentities(pp_id_keys **GAPIdKey, pp_local_irks **GAPIrk, len uint8) uint32
- func SetGAPDeviceName(write_perm *GAPConnSecMode, dev_name *uint8, len uint16) uint32
- func SetGAPLescOobData(conn_handle uint16, oobd_own *GAPLescOobData, oobd_peer *GAPLescOobData) uint32
- func SetGAPPpcp(conn_params *GAPConnParams) uint32
- func SetGAPPrivacy(privacy_params *GAPPrivacyParams) uint32
- func SetGAPTxPower(role uint8, handle uint16, tx_power int8) uint32
- func SetGAPWhitelist(pp_wl_addrs **GAPAddr, len uint8) uint32
- func SetGATTSSysAttr(conn_handle uint16, sys_attr_data *uint8, len uint16, flags uint32) uint32
- func SetGATTSValue(conn_handle uint16, handle uint16, value *GATTSValue) uint32
- func SetOpt(opt_id uint32, opt *Opt) uint32
- func SetupL2capCh(conn_handle uint16, local_cid *uint16, params *L2capChSetupParams) uint32
- func StartGAPAdv(adv_handle uint8, conn_cfg_tag uint8) uint32
- func StartGAPConnEvtTrigger(conn_handle uint16, params *GAPConnEventTrigger) uint32
- func StartGAPQosChannelSurvey(interval_us uint32) uint32
- func StartGAPRssi(conn_handle uint16, threshold_dbm uint8, skip_count uint8) uint32
- func StartGAPScan(scan_params *GAPScanParams, adv_report_buffer *Data) uint32
- func StopGAPAdv(adv_handle uint8) uint32
- func StopGAPConnEvtTrigger(conn_handle uint16) uint32
- func StopGAPQosChannelSurvey() uint32
- func StopGAPRssi(conn_handle uint16) uint32
- func StopGAPScan() uint32
- func TxL2capCh(conn_handle uint16, local_cid uint16, sdu_buf *Data) uint32
- func UpdateGAPConnParam(conn_handle uint16, conn_params *GAPConnParams) uint32
- func UpdateGAPDataLength(conn_handle uint16, dl_params *GAPDataLengthParams, ...) uint32
- func UpdateGAPPhy(conn_handle uint16, gap_phys *GAPPhys) uint32
- func WriteGATTC(conn_handle uint16, write_params *GATTCWriteParams) uint32
- type CommonCfgVSUUID
- type CommonOptPALNA
- type Data
- type EvtHdr
- type EvtUserMemRelease
- type EvtUserMemRequest
- type GAPAdvData
- type GAPAuxPointer
- type GAPCfgCarInclCfg
- type GAPCfgPpcpInclCfg
- type GAPChMask
- type GAPConnCfg
- type GAPConnEventTrigger
- type GAPConnParams
- type GAPConnSec
- type GAPDataLengthLimitation
- type GAPDataLengthParams
- type GAPEncKey
- type GAPEvtAdvSetTerminated
- type GAPEvtAuthKeyRequest
- type GAPEvtConnParamUpdate
- type GAPEvtConnParamUpdateRequest
- type GAPEvtConnSecUpdate
- type GAPEvtConnected
- type GAPEvtDataLengthUpdate
- type GAPEvtDataLengthUpdateRequest
- type GAPEvtDisconnected
- type GAPEvtKeyPressed
- type GAPEvtPhyUpdate
- type GAPEvtPhyUpdateRequest
- type GAPEvtQosChannelSurveyReport
- type GAPEvtRssiChanged
- type GAPEvtScanReqReport
- type GAPEvtSecParamsRequest
- type GAPIdKey
- type GAPIrk
- type GAPLescDhkey
- type GAPLescOobData
- type GAPLescP256Pk
- type GAPMasterId
- type GAPOptAuthPayloadTimeout
- type GAPOptChMap
- type GAPOptLocalConnLatency
- type GAPOptPasskey
- type GAPPhys
- type GAPPrivacyParams
- type GAPSecKeys
- type GAPSecKeyset
- type GAPSignInfo
- type GATTCAttrInfo128
- type GATTCAttrInfo16
- type GATTCConnCfg
- type GATTCDesc
- type GATTCEvtCharDiscRsp
- type GATTCEvtCharValByUUIDReadRsp
- type GATTCEvtCharValsReadRsp
- type GATTCEvtDescDiscRsp
- type GATTCEvtExchangeMtuRsp
- type GATTCEvtHvx
- type GATTCEvtPrimSrvcDiscRsp
- type GATTCEvtReadRsp
- type GATTCEvtRelDiscRsp
- type GATTCEvtTimeout
- type GATTCEvtWriteCmdTxComplete
- type GATTCEvtWriteRsp
- type GATTCHandleRange
- type GATTCHandleValue
- type GATTCInclude
- type GATTCService
- type GATTCWriteParams
- type GATTConnCfg
- type GATTSAttr
- type GATTSCfgAttrTabSize
- type GATTSCharHandles
- type GATTSCharMd
- type GATTSCharPf
- type GATTSConnCfg
- type GATTSEvtExchangeMtuRequest
- type GATTSEvtHvc
- type GATTSEvtHvnTxComplete
- type GATTSEvtRead
- type GATTSEvtSysAttrMissing
- type GATTSEvtTimeout
- type GATTSEvtWrite
- type GATTSHvxParams
- type GATTSValue
- type L2capChRxParams
- type L2capChSetupParams
- type L2capChTxParams
- type L2capConnCfg
- type L2capEvtChCredit
- type L2capEvtChRx
- type L2capEvtChSduBufReleased
- type L2capEvtChSetup
- type L2capEvtChSetupRefused
- type L2capEvtChSetupRequest
- type L2capEvtChTx
- type UUID
- type UUID128
- type UserMemBlock
- type Version
Constants ¶
const ( EVT_USER_MEM_REQUEST = EVT_BASE + 0 // User Memory request. @ref ble_evt_user_mem_request_t EVT_USER_MEM_RELEASE = EVT_BASE + 1 // User Memory release. @ref ble_evt_user_mem_release_t )
const ( CONN_CFG_GAP = CONN_CFG_BASE + 0 // BLE GAP specific connection configuration. CONN_CFG_GATTC = CONN_CFG_BASE + 1 // BLE GATTC specific connection configuration. CONN_CFG_GATTS = CONN_CFG_BASE + 2 // BLE GATTS specific connection configuration. CONN_CFG_GATT = CONN_CFG_BASE + 3 // BLE GATT specific connection configuration. CONN_CFG_L2CAP = CONN_CFG_BASE + 4 // BLE L2CAP specific connection configuration. )
const ( COMMON_OPT_PA_LNA = OPT_BASE + 0 // PA and LNA options COMMON_OPT_CONN_EVT_EXT = OPT_BASE + 1 // Extended connection events option COMMON_OPT_EXTENDED_RC_CAL = OPT_BASE + 2 // Extended RC calibration option )
const ( GAP_EVT_CONNECTED = GAP_EVT_BASE + iota // Connected to peer. \n See @ref ble_gap_evt_connected_t GAP_EVT_DISCONNECTED = GAP_EVT_BASE + 1 // Disconnected from peer. \n See @ref ble_gap_evt_disconnected_t. GAP_EVT_CONN_PARAM_UPDATE = GAP_EVT_BASE + 2 // Connection Parameters updated. \n See @ref ble_gap_evt_conn_param_update_t. GAP_EVT_SEC_PARAMS_REQUEST = GAP_EVT_BASE + 3 // Request to provide security parameters. \n Reply with @ref sd_ble_gap_sec_params_reply. \n See @ref ble_gap_evt_sec_params_request_t. GAP_EVT_SEC_INFO_REQUEST = GAP_EVT_BASE + 4 // Request to provide security information. \n Reply with @ref sd_ble_gap_sec_info_reply. \n See @ref ble_gap_evt_sec_info_request_t. GAP_EVT_PASSKEY_DISPLAY = GAP_EVT_BASE + 5 // Request to display a passkey to the user. \n In LESC Numeric Comparison, reply with @ref sd_ble_gap_auth_key_reply. \n See @ref ble_gap_evt_passkey_display_t. GAP_EVT_KEY_PRESSED = GAP_EVT_BASE + 6 // Notification of a keypress on the remote device.\n See @ref ble_gap_evt_key_pressed_t GAP_EVT_AUTH_KEY_REQUEST = GAP_EVT_BASE + 7 // Request to provide an authentication key. \n Reply with @ref sd_ble_gap_auth_key_reply. \n See @ref ble_gap_evt_auth_key_request_t. GAP_EVT_LESC_DHKEY_REQUEST = GAP_EVT_BASE + 8 // Request to calculate an LE Secure Connections DHKey. \n Reply with @ref sd_ble_gap_lesc_dhkey_reply. \n See @ref ble_gap_evt_lesc_dhkey_request_t GAP_EVT_AUTH_STATUS = GAP_EVT_BASE + 9 // Authentication procedure completed with status. \n See @ref ble_gap_evt_auth_status_t. GAP_EVT_CONN_SEC_UPDATE = GAP_EVT_BASE + 10 // Connection security updated. \n See @ref ble_gap_evt_conn_sec_update_t. GAP_EVT_TIMEOUT = GAP_EVT_BASE + 11 // Timeout expired. \n See @ref ble_gap_evt_timeout_t. GAP_EVT_RSSI_CHANGED = GAP_EVT_BASE + 12 // RSSI report. \n See @ref ble_gap_evt_rssi_changed_t. GAP_EVT_ADV_REPORT = GAP_EVT_BASE + 13 // Advertising report. \n See @ref ble_gap_evt_adv_report_t. GAP_EVT_SEC_REQUEST = GAP_EVT_BASE + 14 // Security Request. \n See @ref ble_gap_evt_sec_request_t. GAP_EVT_CONN_PARAM_UPDATE_REQUEST = GAP_EVT_BASE + 15 // Connection Parameter Update Request. \n Reply with @ref sd_ble_gap_conn_param_update. \n See @ref ble_gap_evt_conn_param_update_request_t. GAP_EVT_SCAN_REQ_REPORT = GAP_EVT_BASE + 16 // Scan request report. \n See @ref ble_gap_evt_scan_req_report_t. GAP_EVT_PHY_UPDATE_REQUEST = GAP_EVT_BASE + 17 // PHY Update Request. \n Reply with @ref sd_ble_gap_phy_update. \n See @ref ble_gap_evt_phy_update_request_t. GAP_EVT_PHY_UPDATE = GAP_EVT_BASE + 18 // PHY Update Procedure is complete. \n See @ref ble_gap_evt_phy_update_t. GAP_EVT_DATA_LENGTH_UPDATE_REQUEST = GAP_EVT_BASE + 19 // Data Length Update Request. \n Reply with @ref sd_ble_gap_data_length_update. \n See @ref ble_gap_evt_data_length_update_request_t. GAP_EVT_DATA_LENGTH_UPDATE = GAP_EVT_BASE + 20 // LL Data Channel PDU payload length updated. \n See @ref ble_gap_evt_data_length_update_t. GAP_EVT_QOS_CHANNEL_SURVEY_REPORT = GAP_EVT_BASE + 21 // Channel survey report. \n See @ref ble_gap_evt_qos_channel_survey_report_t. GAP_EVT_ADV_SET_TERMINATED = GAP_EVT_BASE + 22 // Advertising set terminated. \n See @ref ble_gap_evt_adv_set_terminated_t. )
const ( GAP_OPT_CH_MAP = GAP_OPT_BASE + iota // Channel Map. @ref ble_gap_opt_ch_map_t GAP_OPT_LOCAL_CONN_LATENCY = GAP_OPT_BASE + 1 // Local connection latency. @ref ble_gap_opt_local_conn_latency_t GAP_OPT_PASSKEY = GAP_OPT_BASE + 2 // Set passkey. @ref ble_gap_opt_passkey_t GAP_OPT_COMPAT_MODE_1 = GAP_OPT_BASE + 3 // Compatibility mode. @ref ble_gap_opt_compat_mode_1_t GAP_OPT_AUTH_PAYLOAD_TIMEOUT = GAP_OPT_BASE + 4 // Set Authenticated payload timeout. @ref ble_gap_opt_auth_payload_timeout_t GAP_OPT_SLAVE_LATENCY_DISABLE = GAP_OPT_BASE + 5 // Disable slave latency. @ref ble_gap_opt_slave_latency_disable_t )
const ( GAP_CFG_ROLE_COUNT = GAP_CFG_BASE + iota // Role count configuration. GAP_CFG_DEVICE_NAME = GAP_CFG_BASE + 1 // Device name configuration. GAP_CFG_PPCP_INCL_CONFIG = GAP_CFG_BASE + 2 // Peripheral Preferred Connection Parameters characteristic inclusion configuration. GAP_CFG_CAR_INCL_CONFIG = GAP_CFG_BASE + 3 // Central Address Resolution characteristic inclusion configuration. )
const ( GAP_TX_POWER_ROLE_ADV = 1 + iota // Advertiser role. GAP_TX_POWER_ROLE_SCAN_INIT = 2 // Scanner and initiator role. GAP_TX_POWER_ROLE_CONN = 3 // Connection role. )
const ( GATTC_EVT_PRIM_SRVC_DISC_RSP = GATTC_EVT_BASE + iota // Primary Service Discovery Response event. \n See @ref ble_gattc_evt_prim_srvc_disc_rsp_t. GATTC_EVT_REL_DISC_RSP // Relationship Discovery Response event. \n See @ref ble_gattc_evt_rel_disc_rsp_t. GATTC_EVT_CHAR_DISC_RSP // Characteristic Discovery Response event. \n See @ref ble_gattc_evt_char_disc_rsp_t. GATTC_EVT_DESC_DISC_RSP // Descriptor Discovery Response event. \n See @ref ble_gattc_evt_desc_disc_rsp_t. GATTC_EVT_ATTR_INFO_DISC_RSP // Attribute Information Response event. \n See @ref ble_gattc_evt_attr_info_disc_rsp_t. GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP // Read By UUID Response event. \n See @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t. GATTC_EVT_READ_RSP // Read Response event. \n See @ref ble_gattc_evt_read_rsp_t. GATTC_EVT_CHAR_VALS_READ_RSP // Read multiple Response event. \n See @ref ble_gattc_evt_char_vals_read_rsp_t. GATTC_EVT_WRITE_RSP // Write Response event. \n See @ref ble_gattc_evt_write_rsp_t. GATTC_EVT_HVX // Handle Value Notification or Indication event. \n Confirm indication with @ref sd_ble_gattc_hv_confirm. \n See @ref ble_gattc_evt_hvx_t. GATTC_EVT_EXCHANGE_MTU_RSP // Exchange MTU Response event. \n See @ref ble_gattc_evt_exchange_mtu_rsp_t. GATTC_EVT_TIMEOUT // Timeout event. \n See @ref ble_gattc_evt_timeout_t. GATTC_EVT_WRITE_CMD_TX_COMPLETE // Write without Response transmission complete. \n See @ref ble_gattc_evt_write_cmd_tx_complete_t. )
const ( GATTS_EVT_WRITE = GATTS_EVT_BASE + iota // Write operation performed. \n See @ref ble_gatts_evt_write_t. GATTS_EVT_RW_AUTHORIZE_REQUEST // Read/Write Authorization request. \n Reply with @ref sd_ble_gatts_rw_authorize_reply. \n See @ref ble_gatts_evt_rw_authorize_request_t. GATTS_EVT_SYS_ATTR_MISSING // A persistent system attribute access is pending. \n Respond with @ref sd_ble_gatts_sys_attr_set. \n See @ref ble_gatts_evt_sys_attr_missing_t. GATTS_EVT_HVC // Handle Value Confirmation. \n See @ref ble_gatts_evt_hvc_t. GATTS_EVT_SC_CONFIRM // Service Changed Confirmation. \n No additional event structure applies. GATTS_EVT_EXCHANGE_MTU_REQUEST // Exchange MTU Request. \n Reply with @ref sd_ble_gatts_exchange_mtu_reply. \n See @ref ble_gatts_evt_exchange_mtu_request_t. GATTS_EVT_TIMEOUT // Peer failed to respond to an ATT request in time. \n See @ref ble_gatts_evt_timeout_t. GATTS_EVT_HVN_TX_COMPLETE // Handle Value Notification transmission complete. \n See @ref ble_gatts_evt_hvn_tx_complete_t. )
const ( GATTS_CFG_SERVICE_CHANGED = GATTS_CFG_BASE + iota // Service changed configuration. GATTS_CFG_ATTR_TAB_SIZE // Attribute table size configuration. )
const ( L2CAP_EVT_CH_SETUP_REQUEST = L2CAP_EVT_BASE + 0 // L2CAP Channel Setup Request event. \n See @ref ble_l2cap_evt_ch_setup_request_t. L2CAP_EVT_CH_SETUP_REFUSED = L2CAP_EVT_BASE + 1 // L2CAP Channel Setup Refused event. \n See @ref ble_l2cap_evt_ch_setup_refused_t. L2CAP_EVT_CH_SETUP = L2CAP_EVT_BASE + 2 // L2CAP Channel Setup Completed event. \n See @ref ble_l2cap_evt_ch_setup_t. L2CAP_EVT_CH_RELEASED = L2CAP_EVT_BASE + 3 // L2CAP Channel Released event. \n No additional event structure applies. L2CAP_EVT_CH_SDU_BUF_RELEASED = L2CAP_EVT_BASE + 4 // L2CAP Channel SDU data buffer released event. \n See @ref ble_l2cap_evt_ch_sdu_buf_released_t. L2CAP_EVT_CH_CREDIT = L2CAP_EVT_BASE + 5 // L2CAP Channel Credit received. \n See @ref ble_l2cap_evt_ch_credit_t. L2CAP_EVT_CH_RX = L2CAP_EVT_BASE + 6 // L2CAP Channel SDU received. \n See @ref ble_l2cap_evt_ch_rx_t. L2CAP_EVT_CH_TX = L2CAP_EVT_BASE + 7 // L2CAP Channel SDU transmitted. \n See @ref ble_l2cap_evt_ch_tx_t. )
const APPEARANCE_BLOOD_PRESSURE_ARM = 897 // Blood Pressure: Arm.
const APPEARANCE_BLOOD_PRESSURE_WRIST = 898 // Blood Pressure: Wrist.
const APPEARANCE_CYCLING_CADENCE_SENSOR = 1155 // Cycling: Cadence Sensor.
const APPEARANCE_CYCLING_CYCLING_COMPUTER = 1153 // Cycling: Cycling Computer.
const APPEARANCE_CYCLING_POWER_SENSOR = 1156 // Cycling: Power Sensor.
const APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR = 1157 // Cycling: Speed and Cadence Sensor.
const APPEARANCE_CYCLING_SPEED_SENSOR = 1154 // Cycling: Speed Sensor.
const APPEARANCE_GENERIC_BARCODE_SCANNER = 704 // Generic Barcode Scanner.
const APPEARANCE_GENERIC_BLOOD_PRESSURE = 896 // Generic Blood Pressure.
const APPEARANCE_GENERIC_CLOCK = 256 // Generic Clock.
const APPEARANCE_GENERIC_COMPUTER = 128 // Generic Computer.
const APPEARANCE_GENERIC_CYCLING = 1152 // Generic Cycling.
const APPEARANCE_GENERIC_DISPLAY = 320 // Generic Display.
const APPEARANCE_GENERIC_EYE_GLASSES = 448 // Generic Eye-glasses.
const APPEARANCE_GENERIC_GLUCOSE_METER = 1024 // Generic Glucose Meter.
const APPEARANCE_GENERIC_HEART_RATE_SENSOR = 832 // Generic Heart rate Sensor.
const APPEARANCE_GENERIC_HID = 960 // Human Interface Device (HID).
const APPEARANCE_GENERIC_KEYRING = 576 // Generic Keyring.
const APPEARANCE_GENERIC_MEDIA_PLAYER = 640 // Generic Media Player.
const APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT = 5184 // Generic Outdoor Sports Activity.
const APPEARANCE_GENERIC_PHONE = 64 // Generic Phone.
const APPEARANCE_GENERIC_PULSE_OXIMETER = 3136 // Generic Pulse Oximeter.
const APPEARANCE_GENERIC_REMOTE_CONTROL = 384 // Generic Remote Control.
const APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR = 1088 // Generic Running Walking Sensor.
const APPEARANCE_GENERIC_TAG = 512 // Generic Tag.
const APPEARANCE_GENERIC_THERMOMETER = 768 // Generic Thermometer.
const APPEARANCE_GENERIC_WATCH = 192 // Generic Watch.
const APPEARANCE_GENERIC_WEIGHT_SCALE = 3200 // Generic Weight Scale.
const APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT = 833 // Heart Rate Sensor: Heart Rate Belt.
const APPEARANCE_HID_BARCODE = 968 // Barcode Scanner (HID Subtype).
const APPEARANCE_HID_CARD_READER = 966 // Card Reader (HID Subtype).
const APPEARANCE_HID_DIGITAL_PEN = 967 // Digital Pen (HID Subtype).
const APPEARANCE_HID_DIGITIZERSUBTYPE = 965 // Digitizer Tablet (HID Subtype).
const APPEARANCE_HID_GAMEPAD = 964 // Gamepad (HID Subtype).
const APPEARANCE_HID_JOYSTICK = 963 // Joystick (HID Subtype).
const APPEARANCE_HID_KEYBOARD = 961 // Keyboard (HID Subtype).
const APPEARANCE_HID_MOUSE = 962 // Mouse (HID Subtype).
const APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP = 5186 // Location and Navigation Display Device (Outdoor Sports Activity subtype).
const APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD = 5188 // Location and Navigation Pod (Outdoor Sports Activity subtype).
const APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP = 5185 // Location Display Device (Outdoor Sports Activity subtype).
const APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD = 5187 // Location Pod (Outdoor Sports Activity subtype).
const APPEARANCE_PULSE_OXIMETER_FINGERTIP = 3137 // Fingertip (Pulse Oximeter subtype).
const APPEARANCE_PULSE_OXIMETER_WRIST_WORN = 3138 // Wrist Worn(Pulse Oximeter subtype).
const APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE = 1089 // Running Walking Sensor: In-Shoe.
const APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP = 1091 // Running Walking Sensor: On-Hip.
const APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE = 1090 // Running Walking Sensor: On-Shoe.
const APPEARANCE_THERMOMETER_EAR = 769 // Thermometer: Ear.
const APPEARANCE_UNKNOWN = 0 // Unknown.
const APPEARANCE_WATCH_SPORTS_WATCH = 193 // Watch: Sports Watch.
const CFG_BASE = 0x01 // Common BLE configuration base.
const CFG_INVALID = 0x00 // Invalid BLE configuration.
const CFG_LAST = 0x1F // Common BLE configuration last.
const (
COMMON_CFG_VS_UUID = CFG_BASE + iota // Vendor specific base UUID configuration
)
const CONN_CFG_BASE = 0x20 // BLE connection configuration base.
const CONN_CFG_LAST = 0x3F // BLE connection configuration last.
const CONN_CFG_TAG_DEFAULT = 0 // Default configuration tag, SoftDevice default connection configuration.
const CONN_HANDLE_ALL = 0xFFFE // Applies to all Connection Handles.
const CONN_HANDLE_INVALID = 0xFFFF // Invalid Connection Handle.
const ERROR_BLOCKED_BY_OTHER_LINKS = (nrf.ERROR_STK_BASE_NUM + 0x006) // The attempt to change link settings failed due to the scheduling of other links.
const ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE = (GAP_ERR_BASE + 0x005) // The device identity list contains entries with duplicate identity addresses.
const ERROR_GAP_DEVICE_IDENTITIES_IN_USE = (GAP_ERR_BASE + 0x004) // Attempt to modify the device identity list while already in use by another operation.
const ERROR_GAP_DISCOVERABLE_WITH_WHITELIST = (GAP_ERR_BASE + 0x001) // Use of Whitelist not permitted with discoverable advertising.
const ERROR_GAP_INVALID_BLE_ADDR = (GAP_ERR_BASE + 0x002) // The upper two bits of the address do not correspond to the specified address type.
const ERROR_GAP_UUID_LIST_MISMATCH = (GAP_ERR_BASE + 0x000) // UUID list does not contain an integral number of UUIDs.
const ERROR_GAP_WHITELIST_IN_USE = (GAP_ERR_BASE + 0x003) // Attempt to modify the whitelist while already in use by another operation.
const ERROR_GATTC_PROC_NOT_PERMITTED = (GATTC_ERR_BASE + 0x000) // Procedure not Permitted.
const ERROR_GATTS_INVALID_ATTR_TYPE = (GATTS_ERR_BASE + 0x000) // Invalid attribute type.
const ERROR_GATTS_SYS_ATTR_MISSING = (GATTS_ERR_BASE + 0x001) // System Attributes missing.
const ERROR_INVALID_ADV_HANDLE = (nrf.ERROR_STK_BASE_NUM + 0x004) // Invalid advertising handle.
const ERROR_INVALID_ATTR_HANDLE = (nrf.ERROR_STK_BASE_NUM + 0x003) // Invalid attribute handle.
const ERROR_INVALID_CONN_HANDLE = (nrf.ERROR_STK_BASE_NUM + 0x002) // Invalid connection handle.
const ERROR_INVALID_ROLE = (nrf.ERROR_STK_BASE_NUM + 0x005) // Invalid role.
const ERROR_NOT_ENABLED = (nrf.ERROR_STK_BASE_NUM + 0x001) // @ref sd_ble_enable has not been called.
const EVT_BASE = 0x01 // Common BLE Event base.
const EVT_INVALID = 0x00 // Invalid BLE Event.
const EVT_LAST = 0x0F // Common BLE Event last.
const EVT_PTR_ALIGNMENT = 4
const GAP_ADDR_LEN = (6)
const GAP_ADDR_TYPE_ANONYMOUS = 0x7F // An advertiser may advertise without its address. This type of advertising is called anonymous.
const GAP_ADDR_TYPE_PUBLIC = 0x00 // Public (identity) address.
const GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE = 0x03 // Random private non-resolvable address.
const GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE = 0x02 // Random private resolvable address.
const GAP_ADDR_TYPE_RANDOM_STATIC = 0x01 // Random static (identity) address.
const GAP_ADV_DATA_STATUS_COMPLETE = 0x00 // All data in the advertising event have been received.
const GAP_ADV_DATA_STATUS_INCOMPLETE_MISSED = 0x03 // Failed to receive the remaining data. @note This value will only be used if @ref ble_gap_adv_report_type_t::extended_pdu is set to true.
const GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA = 0x01 // More data to be received. @note This value will only be used if @ref ble_gap_scan_params_t::report_incomplete_evts and @ref ble_gap_adv_report_type_t::extended_pdu are set to true.
const GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED = 0x02 // Incomplete data. Buffer size insufficient to receive more. @note This value will only be used if @ref ble_gap_adv_report_type_t::extended_pdu is set to true.
const GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE = (GAP_ADV_FLAG_LE_GENERAL_DISC_MODE | GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) // LE General Discoverable Mode, BR/EDR not supported.
const GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE = (GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) // LE Limited Discoverable Mode, BR/EDR not supported.
const GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED = (0x04) // BR/EDR not supported.
const GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER = (0x08) // Simultaneous LE and BR/EDR, Controller.
const GAP_ADV_FLAG_LE_BR_EDR_HOST = (0x10) // Simultaneous LE and BR/EDR, Host.
const GAP_ADV_FLAG_LE_GENERAL_DISC_MODE = (0x02) // LE General Discoverable Mode.
const GAP_ADV_FLAG_LE_LIMITED_DISC_MODE = (0x01) // LE Limited Discoverable Mode.
const GAP_ADV_FP_ANY = 0x00 // Allow scan requests and connect requests from any device.
const GAP_ADV_FP_FILTER_BOTH = 0x03 // Filter both scan and connect requests with whitelist.
const GAP_ADV_FP_FILTER_CONNREQ = 0x02 // Filter connect requests with whitelist.
const GAP_ADV_FP_FILTER_SCANREQ = 0x01 // Filter scan requests with whitelist.
const GAP_ADV_INTERVAL_MAX = 0x004000 // Maximum Advertising interval in 625 us units, i.e. 10.24 s.
const GAP_ADV_INTERVAL_MIN = 0x000020 // Minimum Advertising interval in 625 us units, i.e. 20 ms.
const GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE = 0xFF
const GAP_ADV_SET_COUNT_DEFAULT = (1)
const GAP_ADV_SET_COUNT_MAX = (1)
const GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED = (238) // Maximum supported data length for an extended connectable advertising set.
const GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED = (255) // Maximum supported data length for an extended advertising set.
const GAP_ADV_SET_DATA_SIZE_MAX = (31) // Maximum data length for an advertising set. If more advertising data is required, use extended advertising instead.
const GAP_ADV_SET_HANDLE_NOT_SET = (0xFF)
const GAP_ADV_TIMEOUT_GENERAL_UNLIMITED = (0) // Unlimited advertising in general discoverable mode. For high duty cycle advertising, this corresponds to @ref BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX.
const GAP_ADV_TIMEOUT_HIGH_DUTY_MAX = (128) // Maximum high duty advertising time in 10 ms units. Corresponds to 1.28 s.
const GAP_ADV_TIMEOUT_LIMITED_MAX = (18000) // Maximum advertising time in 10 ms units corresponding to TGAP(lim_adv_timeout) = 180 s in limited discoverable mode.
const GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED = 0x03 // Connectable non-scannable directed advertising events. @note Advertising data is not supported.
const GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE = 0x02 // Connectable non-scannable directed advertising events. Advertising interval is less that 3.75 ms. Use this type for fast reconnections. @note Advertising data is not supported.
const GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED = 0x01 // Connectable and scannable undirected advertising events.
const GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_DIRECTED = 0x07 // Connectable non-scannable directed advertising events using extended advertising PDUs.
const GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED = 0x06 // Connectable non-scannable undirected advertising events using extended advertising PDUs.
const GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED = 0x0B // Non-connectable non-scannable directed advertising events using extended advertising PDUs.
const GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED = 0x0A // Non-connectable non-scannable undirected advertising events using extended advertising PDUs.
const GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_DIRECTED = 0x09 // Non-connectable scannable directed advertising events using extended advertising PDUs. @note Only scan response data is supported.
const GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED = 0x08 // Non-connectable scannable undirected advertising events using extended advertising PDUs. @note Only scan response data is supported.
const GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED = 0x05 // Non-connectable non-scannable undirected advertising events.
const GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED = 0x04 // Non-connectable scannable undirected advertising events.
const GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE = 0x07 // Complete list of 128 bit service UUIDs.
const GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE = 0x06 // Partial list of 128 bit service UUIDs.
const GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE = 0x03 // Complete list of 16 bit service UUIDs.
const GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE = 0x02 // Partial list of 16 bit service UUIDs.
const GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE = 0x05 // Complete list of 32 bit service UUIDs.
const GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE = 0x04 // Partial list of 32 bit service UUIDs.
const GAP_AD_TYPE_3D_INFORMATION_DATA = 0x3D // 3D Information Data.
const GAP_AD_TYPE_ADVERTISING_INTERVAL = 0x1A // Advertising Interval.
const GAP_AD_TYPE_APPEARANCE = 0x19 // Appearance.
const GAP_AD_TYPE_CLASS_OF_DEVICE = 0x0D // Class of device.
const GAP_AD_TYPE_COMPLETE_LOCAL_NAME = 0x09 // Complete local device name.
const GAP_AD_TYPE_FLAGS = 0x01 // Flags for discoverability.
const GAP_AD_TYPE_LESC_CONFIRMATION_VALUE = 0x22 // LE Secure Connections Confirmation Value
const GAP_AD_TYPE_LESC_RANDOM_VALUE = 0x23 // LE Secure Connections Random Value
const GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS = 0x1B // LE Bluetooth Device Address.
const GAP_AD_TYPE_LE_ROLE = 0x1C // LE Role.
const GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA = 0xFF // Manufacturer Specific Data.
const GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS = 0x17 // Public Target Address.
const GAP_AD_TYPE_RANDOM_TARGET_ADDRESS = 0x18 // Random Target Address.
const GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS = 0x11 // Security Manager Out Of Band Flags.
const GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE = 0x10 // Security Manager TK Value.
const GAP_AD_TYPE_SERVICE_DATA = 0x16 // Service Data - 16-bit UUID.
const GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID = 0x21 // Service Data - 128-bit UUID.
const GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID = 0x20 // Service Data - 32-bit UUID.
const GAP_AD_TYPE_SHORT_LOCAL_NAME = 0x08 // Short local device name.
const GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C = 0x0E // Simple Pairing Hash C.
const GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256 = 0x1D // Simple Pairing Hash C-256.
const GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R = 0x0F // Simple Pairing Randomizer R.
const GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256 = 0x1E // Simple Pairing Randomizer R-256.
const GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE = 0x12 // Slave Connection Interval Range.
const GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT = 0x15 // List of 128-bit Service Solicitation UUIDs.
const GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT = 0x14 // List of 16-bit Service Solicitation UUIDs.
const GAP_AD_TYPE_TX_POWER_LEVEL = 0x0A // Transmit power level.
const GAP_AD_TYPE_URI = 0x24 // URI
const GAP_AUTH_KEY_TYPE_NONE = 0x00 // No key (may be used to reject).
const GAP_AUTH_KEY_TYPE_OOB = 0x02 // Out Of Band data.
const GAP_AUTH_KEY_TYPE_PASSKEY = 0x01 // 6-digit Passkey.
const GAP_AUTH_PAYLOAD_TIMEOUT_MAX = (48000) // Maximum authenticated payload timeout in 10 ms units, i.e. 8 minutes.
const GAP_AUTH_PAYLOAD_TIMEOUT_MIN = (1) // Minimum authenticated payload timeout in 10 ms units, i.e. 10 ms.
const GAP_CAR_INCL_CONFIG_DEFAULT = (GAP_CHAR_INCL_CONFIG_INCLUDE) // Included by default.
const GAP_CFG_BASE = 0x40 // GAP BLE configuration base.
const GAP_CFG_LAST = 0x5F // GAP BLE configuration last.
const GAP_CHANNEL_COUNT = (40)
const GAP_CHAR_INCL_CONFIG_EXCLUDE_WITHOUT_SPACE = (2) // Do not include the characteristic in the Attribute table. The SoftDevice will not reserve the attribute handles which are otherwise used for this characteristic.
const GAP_CHAR_INCL_CONFIG_EXCLUDE_WITH_SPACE = (1) // Do not include the characteristic in the Attribute table. The SoftDevice will reserve the attribute handles which are otherwise used for this characteristic. By reserving the attribute handles it will be possible to upgrade the SoftDevice without changing handle of the Service Changed characteristic.
const GAP_CHAR_INCL_CONFIG_INCLUDE = (0) // Include the characteristic in the Attribute Table
const GAP_CONN_COUNT_DEFAULT = (1)
const GAP_CP_CONN_SUP_TIMEOUT_MAX = 0x0C80 // Highest supervision timeout permitted, in units of 10 ms, i.e. 32 s.
const GAP_CP_CONN_SUP_TIMEOUT_MIN = 0x000A // Lowest supervision timeout permitted, in units of 10 ms, i.e. 100 ms.
const GAP_CP_CONN_SUP_TIMEOUT_NONE = 0xFFFF // No new supervision timeout specified in connect parameters.
const GAP_CP_MAX_CONN_INTVL_MAX = 0x0C80 // Highest maximum connection interval permitted, in units of 1.25 ms, i.e. 4 s.
const GAP_CP_MAX_CONN_INTVL_MIN = 0x0006 // Lowest maximum connection interval permitted, in units of 1.25 ms, i.e. 7.5 ms.
const GAP_CP_MAX_CONN_INTVL_NONE = 0xFFFF // No new maximum connection interval specified in connect parameters.
const GAP_CP_MIN_CONN_INTVL_MAX = 0x0C80 // Highest minimum connection interval permitted, in units of 1.25 ms, i.e. 4 s.
const GAP_CP_MIN_CONN_INTVL_MIN = 0x0006 // Lowest minimum connection interval permitted, in units of 1.25 ms, i.e. 7.5 ms.
const GAP_CP_MIN_CONN_INTVL_NONE = 0xFFFF // No new minimum connection interval specified in connect parameters.
const GAP_CP_SLAVE_LATENCY_MAX = 0x01F3 // Highest slave latency permitted, in connection events.
const GAP_DATA_LENGTH_AUTO = 0
const GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S = (900) // 15 minutes.
const GAP_DEVICE_IDENTITIES_MAX_COUNT = (8)
const GAP_DEVNAME_DEFAULT = "nRF5x" // Default device name value.
const GAP_DEVNAME_DEFAULT_LEN = 31 // Default number of octets in device name.
const GAP_DEVNAME_MAX_LEN = 248 // Maximum number of octets in device name.
const GAP_DISC_MODE_GENERAL = 0x02 // General Discovery Mode.
const GAP_DISC_MODE_LIMITED = 0x01 // Limited Discovery Mode.
const GAP_DISC_MODE_NOT_DISCOVERABLE = 0x00 // Not discoverable discovery Mode.
const GAP_ERR_BASE = (nrf.ERROR_STK_BASE_NUM + 0x200) // GAP specific errors.
const GAP_EVENT_LENGTH_CODED_PHY_MIN = (6) // The shortest event length in 1.25 ms units supporting LE Coded PHY.
const GAP_EVENT_LENGTH_DEFAULT = (3) // Default event length, in 1.25 ms units.
const GAP_EVENT_LENGTH_MIN = (2) // Minimum event length, in 1.25 ms units.
const GAP_EVT_ADV_SET_TERMINATED_REASON_LIMIT_REACHED = 0x02 // @ref ble_gap_adv_params_t::max_adv_evts was reached.
const GAP_EVT_ADV_SET_TERMINATED_REASON_TIMEOUT = 0x01 // Timeout value reached.
const GAP_EVT_BASE = 0x10 // GAP BLE Event base.
const GAP_EVT_LAST = 0x2F // GAP BLE Event last.
const GAP_IO_CAPS_DISPLAY_ONLY = 0x00 // Display Only.
const GAP_IO_CAPS_DISPLAY_YESNO = 0x01 // Display and Yes/No entry.
const GAP_IO_CAPS_KEYBOARD_DISPLAY = 0x04 // Keyboard and Display.
const GAP_IO_CAPS_KEYBOARD_ONLY = 0x02 // Keyboard Only.
const GAP_IO_CAPS_NONE = 0x03 // No I/O capabilities.
const GAP_KP_NOT_TYPE_PASSKEY_CLEAR = 0x03 // Passkey cleared.
const GAP_KP_NOT_TYPE_PASSKEY_DIGIT_IN = 0x01 // Passkey digit entered.
const GAP_KP_NOT_TYPE_PASSKEY_DIGIT_OUT = 0x02 // Passkey digit erased.
const GAP_KP_NOT_TYPE_PASSKEY_END = 0x04 // Passkey entry completed.
const GAP_KP_NOT_TYPE_PASSKEY_START = 0x00 // Passkey entry started.
const GAP_LESC_DHKEY_LEN = 32
const GAP_LESC_P256_PK_LEN = 64
const GAP_MAX_PRIVATE_ADDR_CYCLE_INTERVAL_S = (41400) // 11 hours 30 minutes.
const GAP_OPT_BASE = 0x20 // GAP BLE Option base.
const GAP_OPT_LAST = 0x3F // GAP BLE Option last.
const GAP_PASSKEY_LEN = 6
const GAP_PHYS_SUPPORTED = (GAP_PHY_1MBPS | GAP_PHY_2MBPS | GAP_PHY_CODED) // All PHYs are supported.
const GAP_PHY_1MBPS = 0x01 // 1 Mbps PHY.
const GAP_PHY_2MBPS = 0x02 // 2 Mbps PHY.
const GAP_PHY_AUTO = 0x00 // Automatic PHY selection. Refer @ref sd_ble_gap_phy_update for more information.
const GAP_PHY_CODED = 0x04 // Coded PHY.
const GAP_PHY_NOT_SET = 0xFF // PHY is not configured.
const GAP_POWER_LEVEL_INVALID = 127
const GAP_PPCP_INCL_CONFIG_DEFAULT = (GAP_CHAR_INCL_CONFIG_INCLUDE) // Included by default.
const GAP_PRIVACY_MODE_DEVICE_PRIVACY = 0x01 // Device will send and accept only private addresses for its own address.
const GAP_PRIVACY_MODE_NETWORK_PRIVACY = 0x02 // Device will send and accept only private addresses for its own address, and will not accept a peer using identity address as sender address when the peer IRK is exchanged, non-zero and added to the identity list.
const GAP_PRIVACY_MODE_OFF = 0x00 // Device will send and accept its identity address for its own address.
const GAP_QOS_CHANNEL_SURVEY_INTERVAL_CONTINUOUS = (0) // Continuous channel survey.
const GAP_QOS_CHANNEL_SURVEY_INTERVAL_MAX_US = (4000000) // Maximum channel survey interval in microseconds (4 s).
const GAP_QOS_CHANNEL_SURVEY_INTERVAL_MIN_US = (7500) // Minimum channel survey interval in microseconds (7.5 ms).
const GAP_ROLE_CENTRAL = 0x2 // Central Role.
const GAP_ROLE_COUNT_CENTRAL_DEFAULT = (3) // Default maximum number of connections concurrently acting as centrals.
const GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT = (1) // Default number of SMP instances shared between all connections acting as centrals.
const GAP_ROLE_COUNT_COMBINED_MAX = (20) // Maximum supported number of concurrent connections in the peripheral and central roles combined.
const GAP_ROLE_COUNT_PERIPH_DEFAULT = (1) // Default maximum number of connections concurrently acting as peripherals.
const GAP_ROLE_INVALID = 0x0 // Invalid Role.
const GAP_ROLE_PERIPH = 0x1 // Peripheral Role.
const GAP_RSSI_THRESHOLD_INVALID = 0xFF
const GAP_SCAN_BUFFER_EXTENDED_MAX = (1650) // Maximum data length for an extended advertising set.
const GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED = (255) // Maximum supported data length for an extended advertising set.
const GAP_SCAN_BUFFER_EXTENDED_MIN = (255) // Minimum data length for an extended advertising set.
const GAP_SCAN_BUFFER_MAX = (31) // Maximum data length for an advertising set.
const GAP_SCAN_BUFFER_MIN = (31) // Minimum data length for an advertising set.
const GAP_SCAN_FP_ACCEPT_ALL = 0x00 // Accept all advertising packets except directed advertising packets not addressed to this device.
const GAP_SCAN_FP_ALL_NOT_RESOLVED_DIRECTED = 0x02 // Accept all advertising packets specified in @ref BLE_GAP_SCAN_FP_ACCEPT_ALL. In addition, accept directed advertising packets, where the advertiser's address is a resolvable private address that cannot be resolved.
const GAP_SCAN_FP_WHITELIST = 0x01 // Accept advertising packets from devices in the whitelist except directed packets not addressed to this device.
const GAP_SCAN_FP_WHITELIST_NOT_RESOLVED_DIRECTED = 0x03 // Accept all advertising packets specified in @ref BLE_GAP_SCAN_FP_WHITELIST. In addition, accept directed advertising packets, where the advertiser's address is a resolvable private address that cannot be resolved.
const GAP_SCAN_INTERVAL_MAX = 0xFFFF // Maximum Scan interval in 625 us units, i.e. 40,959.375 s.
const GAP_SCAN_INTERVAL_MIN = 0x0004 // Minimum Scan interval in 625 us units, i.e. 2.5 ms.
const GAP_SCAN_TIMEOUT_MIN = 0x0001 // Minimum Scan timeout in 10 ms units, i.e 10 ms.
const GAP_SCAN_TIMEOUT_UNLIMITED = 0x0000 // Continue to scan forever.
const GAP_SCAN_WINDOW_MAX = 0xFFFF // Maximum Scan window in 625 us units, i.e. 40,959.375 s.
const GAP_SCAN_WINDOW_MIN = 0x0004 // Minimum Scan window in 625 us units, i.e. 2.5 ms.
const GAP_SEC_KEY_LEN = 16
const GAP_SEC_MODE = 0x00 // No key (may be used to reject).
const GAP_SEC_RAND_LEN = 8
const GAP_SEC_STATUS_AUTH_REQ = 0x83 // Authentication requirements not met.
const GAP_SEC_STATUS_BR_EDR_IN_PROG = 0x8D // BR/EDR pairing in progress.
const GAP_SEC_STATUS_CONFIRM_VALUE = 0x84 // Confirm value failed.
const GAP_SEC_STATUS_DHKEY_FAILURE = 0x8B // DHKey check failure.
const GAP_SEC_STATUS_ENC_KEY_SIZE = 0x86 // Encryption key size.
const GAP_SEC_STATUS_INVALID_PARAMS = 0x8A // Invalid parameters.
const GAP_SEC_STATUS_NUM_COMP_FAILURE = 0x8C // Numeric Comparison failure.
const GAP_SEC_STATUS_OOB_NOT_AVAILABLE = 0x82 // Out of Band Key not available.
const GAP_SEC_STATUS_PAIRING_NOT_SUPP = 0x85 // Pairing not supported.
const GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED = 0x81 // Passkey entry failed (user canceled or other).
const GAP_SEC_STATUS_PDU_INVALID = 0x02 // Invalid PDU received.
const GAP_SEC_STATUS_REPEATED_ATTEMPTS = 0x89 // Too little time elapsed since last attempt.
const GAP_SEC_STATUS_RFU_RANGE1_BEGIN = 0x03 // Reserved for Future Use range #1 begin.
const GAP_SEC_STATUS_RFU_RANGE1_END = 0x80 // Reserved for Future Use range #1 end.
const GAP_SEC_STATUS_RFU_RANGE2_BEGIN = 0x8F // Reserved for Future Use range #2 begin.
const GAP_SEC_STATUS_RFU_RANGE2_END = 0xFF // Reserved for Future Use range #2 end.
const GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED = 0x87 // Unsupported SMP command.
const GAP_SEC_STATUS_SOURCE_LOCAL = 0x00 // Local failure.
const GAP_SEC_STATUS_SOURCE_REMOTE = 0x01 // Remote failure.
const GAP_SEC_STATUS_SUCCESS = 0x00 // Procedure completed with success.
const GAP_SEC_STATUS_TIMEOUT = 0x01 // Procedure timed out.
const GAP_SEC_STATUS_UNSPECIFIED = 0x88 // Unspecified reason.
const GAP_SEC_STATUS_X_TRANS_KEY_DISALLOWED = 0x8E // BR/EDR Link Key cannot be used for LE keys.
const GAP_SVC_BASE = 0x6C // GAP BLE SVC base.
const GAP_SVC_LAST = 0x9A // GAP BLE SVC last.
const GAP_TIMEOUT_SRC_AUTH_PAYLOAD = 0x03 // Authenticated payload timeout.
const GAP_TIMEOUT_SRC_CONN = 0x02 // Connection timeout.
const GAP_TIMEOUT_SRC_SCAN = 0x01 // Scanning timeout.
const GAP_WHITELIST_ADDR_MAX_COUNT = (8)
const GATTC_ATTR_INFO_FORMAT_128BIT = 2 // 128-bit Attribute Information Format.
const GATTC_ATTR_INFO_FORMAT_16BIT = 1 // 16-bit Attribute Information Format.
const GATTC_CFG_BASE = 0x80 // GATTC BLE configuration base.
const GATTC_CFG_LAST = 0x9F // GATTC BLE configuration last.
const GATTC_ERR_BASE = (nrf.ERROR_STK_BASE_NUM + 0x300) // GATT client specific errors.
const GATTC_EVT_BASE = 0x30 // GATTC BLE Event base.
const GATTC_EVT_LAST = 0x4F // GATTC BLE Event last.
const GATTC_OPT_BASE = 0x60 // GATTC BLE Option base.
const GATTC_OPT_LAST = 0x7F // GATTC BLE Option last.
const GATTC_SVC_BASE = 0x9B // GATTC BLE SVC base.
const GATTC_SVC_LAST = 0xA7 // GATTC BLE SVC last.
const GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT = 1 // Default number of Write without Response that can be queued for transmission.
const GATTS_ATTR_TAB_SIZE_DEFAULT = (1408) // Default Attribute Table size.
const GATTS_ATTR_TAB_SIZE_MIN = (248) // Minimum Attribute Table size
const GATTS_ATTR_TYPE_CHAR_DECL = 0x04 // Characteristic Declaration.
const GATTS_ATTR_TYPE_CHAR_VAL = 0x05 // Characteristic Value.
const GATTS_ATTR_TYPE_DESC = 0x06 // Descriptor.
const GATTS_ATTR_TYPE_INC_DECL = 0x03 // Include Declaration.
const GATTS_ATTR_TYPE_INVALID = 0x00 // Invalid Attribute Type.
const GATTS_ATTR_TYPE_OTHER = 0x07 // Other, non-GATT specific type.
const GATTS_ATTR_TYPE_PRIM_SRVC_DECL = 0x01 // Primary Service Declaration.
const GATTS_ATTR_TYPE_SEC_SRVC_DECL = 0x02 // Secondary Service Declaration.
const GATTS_AUTHORIZE_TYPE_INVALID = 0x00 // Invalid Type.
const GATTS_AUTHORIZE_TYPE_READ = 0x01 // Authorize a Read Operation.
const GATTS_AUTHORIZE_TYPE_WRITE = 0x02 // Authorize a Write Request Operation.
const GATTS_CFG_BASE = 0xA0 // GATTS BLE configuration base.
const GATTS_CFG_LAST = 0xBF // GATTS BLE configuration last.
const GATTS_ERR_BASE = (nrf.ERROR_STK_BASE_NUM + 0x400) // GATT server specific errors.
const GATTS_EVT_BASE = 0x50 // GATTS BLE Event base.
const GATTS_EVT_LAST = 0x6F // GATTS BLE Event last.
const GATTS_FIX_ATTR_LEN_MAX = (510) // Maximum length for fixed length Attribute Values.
const GATTS_HVN_TX_QUEUE_SIZE_DEFAULT = 1 // Default number of Handle Value Notifications that can be queued for transmission.
const GATTS_OPT_BASE = 0x80 // GATTS BLE Option base.
const GATTS_OPT_LAST = 0x9F // GATTS BLE Option last.
const GATTS_OP_EXEC_WRITE_REQ_CANCEL = 0x05 // Execute Write Request: Cancel all prepared writes.
const GATTS_OP_EXEC_WRITE_REQ_NOW = 0x06 // Execute Write Request: Immediately execute all prepared writes.
const GATTS_OP_INVALID = 0x00 // Invalid Operation.
const GATTS_OP_PREP_WRITE_REQ = 0x04 // Prepare Write Request.
const GATTS_OP_SIGN_WRITE_CMD = 0x03 // Signed Write Command.
const GATTS_OP_WRITE_CMD = 0x02 // Write Command.
const GATTS_OP_WRITE_REQ = 0x01 // Write Request.
const GATTS_SERVICE_CHANGED_DEFAULT = (1) // Default is to include the Service Changed characteristic in the Attribute Table.
const GATTS_SRVC_TYPE_INVALID = 0x00 // Invalid Service Type.
const GATTS_SRVC_TYPE_PRIMARY = 0x01 // Primary Service.
const GATTS_SRVC_TYPE_SECONDARY = 0x02 // Secondary Type.
const GATTS_SVC_BASE = 0xA8 // GATTS BLE SVC base.
const GATTS_SVC_LAST = 0xB7 // GATTS BLE SVC last.
const GATTS_SYS_ATTR_FLAG_SYS_SRVCS = (1 << 0) // Restrict system attributes to system services only.
const GATTS_SYS_ATTR_FLAG_USR_SRVCS = (1 << 1) // Restrict system attributes to user services only.
const GATTS_VAR_ATTR_LEN_MAX = (512) // Maximum length for variable length Attribute Values.
const GATTS_VLOC_INVALID = 0x00 // Invalid Location.
const GATTS_VLOC_STACK = 0x01 // Attribute Value is located in stack memory, no user memory is required.
const GATTS_VLOC_USER = 0x02 // Attribute Value is located in user memory. This requires the user to maintain a valid buffer through the lifetime of the attribute, since the stack will read and write directly to the memory using the pointer provided in the APIs. There are no alignment requirements for the buffer.
const GATT_ATT_MTU_DEFAULT = 23
const GATT_CFG_BASE = 0x60 // GATT BLE configuration base.
const GATT_CFG_LAST = 0x7F // GATT BLE configuration last.
const GATT_CPF_FORMAT_2BIT = 0x02 // Unsigned 2-bit integer.
const GATT_CPF_FORMAT_BOOLEAN = 0x01 // Boolean.
const GATT_CPF_FORMAT_DUINT16 = 0x18 // IEEE-20601 format.
const GATT_CPF_FORMAT_FLOAT = 0x17 // IEEE-11073 32-bit FLOAT.
const GATT_CPF_FORMAT_FLOAT32 = 0x14 // IEEE-754 32-bit floating point.
const GATT_CPF_FORMAT_FLOAT64 = 0x15 // IEEE-754 64-bit floating point.
const GATT_CPF_FORMAT_NIBBLE = 0x03 // Unsigned 4-bit integer.
const GATT_CPF_FORMAT_RFU = 0x00 // Reserved For Future Use.
const GATT_CPF_FORMAT_SFLOAT = 0x16 // IEEE-11073 16-bit SFLOAT.
const GATT_CPF_FORMAT_SINT12 = 0x0D // Signed 12-bit integer.
const GATT_CPF_FORMAT_SINT128 = 0x13 // Signed 128-bit integer.
const GATT_CPF_FORMAT_SINT16 = 0x0E // Signed 16-bit integer.
const GATT_CPF_FORMAT_SINT24 = 0x0F // Signed 24-bit integer.
const GATT_CPF_FORMAT_SINT32 = 0x10 // Signed 32-bit integer.
const GATT_CPF_FORMAT_SINT48 = 0x11 // Signed 48-bit integer.
const GATT_CPF_FORMAT_SINT64 = 0x12 // Signed 64-bit integer.
const GATT_CPF_FORMAT_SINT8 = 0x0C // Signed 2-bit integer.
const GATT_CPF_FORMAT_STRUCT = 0x1B // Opaque Structure.
const GATT_CPF_FORMAT_UINT12 = 0x05 // Unsigned 12-bit integer.
const GATT_CPF_FORMAT_UINT128 = 0x0B // Unsigned 128-bit integer.
const GATT_CPF_FORMAT_UINT16 = 0x06 // Unsigned 16-bit integer.
const GATT_CPF_FORMAT_UINT24 = 0x07 // Unsigned 24-bit integer.
const GATT_CPF_FORMAT_UINT32 = 0x08 // Unsigned 32-bit integer.
const GATT_CPF_FORMAT_UINT48 = 0x09 // Unsigned 48-bit integer.
const GATT_CPF_FORMAT_UINT64 = 0x0A // Unsigned 64-bit integer.
const GATT_CPF_FORMAT_UINT8 = 0x04 // Unsigned 8-bit integer.
const GATT_CPF_FORMAT_UTF16S = 0x1A // UTF-16 string.
const GATT_CPF_FORMAT_UTF8S = 0x19 // UTF-8 string.
const GATT_CPF_NAMESPACE_BTSIG = 0x01 // Bluetooth SIG defined Namespace.
const GATT_CPF_NAMESPACE_DESCRIPTION_UNKNOWN = 0x0000 // Namespace Description Unknown.
const GATT_EXEC_WRITE_FLAG_PREPARED_CANCEL = 0x00 // Cancel prepared write.
const GATT_EXEC_WRITE_FLAG_PREPARED_WRITE = 0x01 // Execute prepared write.
const GATT_HANDLE_END = 0xFFFF
const GATT_HANDLE_INVALID = 0x0000
const GATT_HANDLE_START = 0x0001
const GATT_HVX_INDICATION = 0x02 // Handle Value Indication.
const GATT_HVX_INVALID = 0x00 // Invalid Operation.
const GATT_HVX_NOTIFICATION = 0x01 // Handle Value Notification.
const GATT_OPT_BASE = 0x40 // GATT BLE Option base.
const GATT_OPT_LAST = 0x5F // GATT BLE Option last.
const GATT_OP_EXEC_WRITE_REQ = 0x05 // Execute Write Request.
const GATT_OP_INVALID = 0x00 // Invalid Operation.
const GATT_OP_PREP_WRITE_REQ = 0x04 // Prepare Write Request.
const GATT_OP_SIGN_WRITE_CMD = 0x03 // Signed Write Command.
const GATT_OP_WRITE_CMD = 0x02 // Write Command.
const GATT_OP_WRITE_REQ = 0x01 // Write Request.
const GATT_STATUS_ATTERR_APP_BEGIN = 0x0180 // ATT Error: Application range begin.
const GATT_STATUS_ATTERR_APP_END = 0x019F // ATT Error: Application range end.
const GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND = 0x010A // ATT Error: Used in ATT as Attribute not found.
const GATT_STATUS_ATTERR_ATTRIBUTE_NOT_LONG = 0x010B // ATT Error: Attribute cannot be read or written using read/write blob requests.
const GATT_STATUS_ATTERR_CPS_CCCD_CONFIG_ERROR = 0x01FD // ATT Common Profile and Service Error: Client Characteristic Configuration Descriptor improperly configured.
const GATT_STATUS_ATTERR_CPS_OUT_OF_RANGE = 0x01FF // ATT Common Profile and Service Error: Out Of Range.
const GATT_STATUS_ATTERR_CPS_PROC_ALR_IN_PROG = 0x01FE // ATT Common Profile and Service Error: Procedure Already in Progress.
const GATT_STATUS_ATTERR_CPS_WRITE_REQ_REJECTED = 0x01FC // ATT Common Profile and Service Error: Write request rejected.
const GATT_STATUS_ATTERR_INSUF_AUTHENTICATION = 0x0105 // ATT Error: Authenticated link required.
const GATT_STATUS_ATTERR_INSUF_AUTHORIZATION = 0x0108 // ATT Error: Used in ATT as Insufficient Authorization.
const GATT_STATUS_ATTERR_INSUF_ENCRYPTION = 0x010F // ATT Error: Encrypted link required.
const GATT_STATUS_ATTERR_INSUF_ENC_KEY_SIZE = 0x010C // ATT Error: Encryption key size used is insufficient.
const GATT_STATUS_ATTERR_INSUF_RESOURCES = 0x0111 // ATT Error: Insufficient resources.
const GATT_STATUS_ATTERR_INVALID = 0x0100 // ATT Error: Invalid Error Code.
const GATT_STATUS_ATTERR_INVALID_ATT_VAL_LENGTH = 0x010D // ATT Error: Invalid value size.
const GATT_STATUS_ATTERR_INVALID_HANDLE = 0x0101 // ATT Error: Invalid Attribute Handle.
const GATT_STATUS_ATTERR_INVALID_OFFSET = 0x0107 // ATT Error: Offset specified was past the end of the attribute.
const GATT_STATUS_ATTERR_INVALID_PDU = 0x0104 // ATT Error: Used in ATT as Invalid PDU.
const GATT_STATUS_ATTERR_PREPARE_QUEUE_FULL = 0x0109 // ATT Error: Used in ATT as Prepare Queue Full.
const GATT_STATUS_ATTERR_READ_NOT_PERMITTED = 0x0102 // ATT Error: Read not permitted.
const GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED = 0x0106 // ATT Error: Used in ATT as Request Not Supported.
const GATT_STATUS_ATTERR_RFU_RANGE1_BEGIN = 0x0112 // ATT Error: Reserved for Future Use range #1 begin.
const GATT_STATUS_ATTERR_RFU_RANGE1_END = 0x017F // ATT Error: Reserved for Future Use range #1 end.
const GATT_STATUS_ATTERR_RFU_RANGE2_BEGIN = 0x01A0 // ATT Error: Reserved for Future Use range #2 begin.
const GATT_STATUS_ATTERR_RFU_RANGE2_END = 0x01DF // ATT Error: Reserved for Future Use range #2 end.
const GATT_STATUS_ATTERR_RFU_RANGE3_BEGIN = 0x01E0 // ATT Error: Reserved for Future Use range #3 begin.
const GATT_STATUS_ATTERR_RFU_RANGE3_END = 0x01FC // ATT Error: Reserved for Future Use range #3 end.
const GATT_STATUS_ATTERR_UNLIKELY_ERROR = 0x010E // ATT Error: Very unlikely error.
const GATT_STATUS_ATTERR_UNSUPPORTED_GROUP_TYPE = 0x0110 // ATT Error: Attribute type is not a supported grouping attribute.
const GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED = 0x0103 // ATT Error: Write not permitted.
const GATT_STATUS_SUCCESS = 0x0000 // Success.
const GATT_STATUS_UNKNOWN = 0x0001 // Unknown or not applicable status.
const GATT_TIMEOUT_SRC_PROTOCOL = 0x00 // ATT Protocol timeout.
const HCI_AUTHENTICATION_FAILURE = 0x05 // Authentication Failure.
const HCI_CONNECTION_TIMEOUT = 0x08 // Connection Timeout.
const HCI_CONN_FAILED_TO_BE_ESTABLISHED = 0x3E // Connection Failed to be Established.
const HCI_CONN_INTERVAL_UNACCEPTABLE = 0x3B // Connection Interval Unacceptable.
const HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE = 0x3D // Connection Terminated due to MIC Failure.
const HCI_CONTROLLER_BUSY = 0x3A // Controller Busy.
const HCI_DIFFERENT_TRANSACTION_COLLISION = 0x2A // Different Transaction Collision.
const HCI_DIRECTED_ADVERTISER_TIMEOUT = 0x3C // Directed Advertisement Timeout.
const HCI_INSTANT_PASSED = 0x28 // Instant Passed.
const HCI_LOCAL_HOST_TERMINATED_CONNECTION = 0x16 // Local Host Terminated Connection.
const HCI_MEMORY_CAPACITY_EXCEEDED = 0x07 // Memory Capacity Exceeded.
const HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED = 0x29 // Pairing with Unit Key Unsupported.
const HCI_PARAMETER_OUT_OF_MANDATORY_RANGE = 0x30 // Parameter Out Of Mandatory Range.
const HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES = 0x14 // Remote Device Terminated Connection due to low resources.
const HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF = 0x15 // Remote Device Terminated Connection due to power off.
const HCI_REMOTE_USER_TERMINATED_CONNECTION = 0x13 // Remote User Terminated Connection.
const HCI_STATUS_CODE_COMMAND_DISALLOWED = 0x0C // Command Disallowed.
const HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS = 0x12 // Invalid BLE Command Parameters.
const HCI_STATUS_CODE_INVALID_LMP_PARAMETERS = 0x1E // Invalid LMP Parameters.
const HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION = 0x23 // LMP Error Transaction Collision/LL Procedure Collision.
const HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED = 0x24 // LMP PDU Not Allowed.
const HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT = 0x22 // LMP Response Timeout.
const HCI_STATUS_CODE_PIN_OR_KEY_MISSING = 0x06 // Pin or Key missing.
const HCI_STATUS_CODE_SUCCESS = 0x00 // Success.
const HCI_STATUS_CODE_UNKNOWN_BTLE_COMMAND = 0x01 // Unknown BLE Command.
const HCI_STATUS_CODE_UNKNOWN_CONNECTION_IDENTIFIER = 0x02 // Unknown Connection Identifier.
const HCI_STATUS_CODE_UNSPECIFIED_ERROR = 0x1F // Unspecified Error.
const HCI_UNSUPPORTED_REMOTE_FEATURE = 0x1A // Unsupported Remote Feature.
const L2CAP_CFG_BASE = 0xC0 // L2CAP BLE configuration base.
const L2CAP_CFG_LAST = 0xDF // L2CAP BLE configuration last.
const L2CAP_CH_COUNT_MAX = (64)
const L2CAP_CH_SETUP_REFUSED_SRC_LOCAL = (0x01) // Local.
const L2CAP_CH_SETUP_REFUSED_SRC_REMOTE = (0x02) // Remote.
const L2CAP_CH_STATUS_CODE_INSUFF_AUTHENTICATION = (0x0005) // Insufficient authentication.
const L2CAP_CH_STATUS_CODE_INSUFF_AUTHORIZATION = (0x0006) // Insufficient authorization.
const L2CAP_CH_STATUS_CODE_INSUFF_ENC = (0x0008) // Insufficient encryption.
const L2CAP_CH_STATUS_CODE_INSUFF_ENC_KEY_SIZE = (0x0007) // Insufficient encryption key size.
const L2CAP_CH_STATUS_CODE_INVALID_SCID = (0x0009) // Invalid Source CID.
const L2CAP_CH_STATUS_CODE_LE_PSM_NOT_SUPPORTED = (0x0002) // LE_PSM not supported.
const L2CAP_CH_STATUS_CODE_NOT_UNDERSTOOD = (0x8000) // Command Reject received instead of LE Credit Based Connection Response.
const L2CAP_CH_STATUS_CODE_NO_RESOURCES = (0x0004) // No resources available.
const L2CAP_CH_STATUS_CODE_SCID_ALLOCATED = (0x000A) // Source CID already allocated.
const L2CAP_CH_STATUS_CODE_SUCCESS = (0x0000) // Success.
const L2CAP_CH_STATUS_CODE_TIMEOUT = (0xC000) // Operation timed out.
const L2CAP_CH_STATUS_CODE_UNACCEPTABLE_PARAMS = (0x000B) // Unacceptable parameters.
const L2CAP_CID_INVALID = (0x0000)
const L2CAP_CREDITS_DEFAULT = (1)
const L2CAP_ERR_BASE = (nrf.ERROR_STK_BASE_NUM + 0x100) // L2CAP specific errors.
const L2CAP_EVT_BASE = 0x70 // L2CAP BLE Event base.
const L2CAP_EVT_LAST = 0x8F // L2CAP BLE Event last.
const L2CAP_MPS_MIN = (23)
const L2CAP_MTU_MIN = (23)
const L2CAP_OPT_BASE = 0xA0 // L2CAP BLE Option base.
const L2CAP_OPT_LAST = 0xBF // L2CAP BLE Option last.
const L2CAP_SVC_BASE = 0xB8 // L2CAP BLE SVC base.
const L2CAP_SVC_LAST = 0xBF // L2CAP BLE SVC last.
const OPT_BASE = 0x01 // Common BLE Option base.
const OPT_INVALID = 0x00 // Invalid BLE Option.
const OPT_LAST = 0x1F // Common BLE Option last.
const SVC_BASE = 0x60 // Common BLE SVC base.
const SVC_LAST = 0x6B // Common BLE SVC last.
const USER_MEM_TYPE_GATTS_QUEUED_WRITES = 0x01 // User Memory for GATTS queued writes.
const USER_MEM_TYPE_INVALID = 0x00 // Invalid User Memory Types.
const UUID_CHARACTERISTIC = 0x2803 // Characteristic.
const UUID_DESCRIPTOR_CHAR_AGGREGATE_FORMAT = 0x2905 // Characteristic Aggregate Format Descriptor.
const UUID_DESCRIPTOR_CHAR_EXT_PROP = 0x2900 // Characteristic Extended Properties Descriptor.
const UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT = 0x2904 // Characteristic Presentation Format Descriptor.
const UUID_DESCRIPTOR_CHAR_USER_DESC = 0x2901 // Characteristic User Description Descriptor.
const UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG = 0x2902 // Client Characteristic Configuration Descriptor.
const UUID_DESCRIPTOR_SERVER_CHAR_CONFIG = 0x2903 // Server Characteristic Configuration Descriptor.
const UUID_GAP = 0x1800 // Generic Access Profile.
const UUID_GAP_CHARACTERISTIC_APPEARANCE = 0x2A01 // Appearance Characteristic.
const UUID_GAP_CHARACTERISTIC_CAR = 0x2AA6 // Central Address Resolution Characteristic.
const UUID_GAP_CHARACTERISTIC_DEVICE_NAME = 0x2A00 // Device Name Characteristic.
const UUID_GAP_CHARACTERISTIC_PPCP = 0x2A04 // Peripheral Preferred Connection Parameters Characteristic.
const UUID_GAP_CHARACTERISTIC_RECONN_ADDR = 0x2A03 // Reconnection Address Characteristic.
const UUID_GAP_CHARACTERISTIC_RPA_ONLY = 0x2AC9 // Resolvable Private Address Only Characteristic.
const UUID_GATT = 0x1801 // Generic Attribute Profile.
const UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED = 0x2A05 // Service Changed Characteristic.
const UUID_SERVICE_INCLUDE = 0x2802 // Include.
const UUID_SERVICE_PRIMARY = 0x2800 // Primary Service.
const UUID_SERVICE_SECONDARY = 0x2801 // Secondary Service.
const UUID_TYPE_BLE = 0x01 // Bluetooth SIG UUID (16-bit).
const UUID_TYPE_UNKNOWN = 0x00 // Invalid UUID type.
const UUID_TYPE_VENDOR_BEGIN = 0x02 // Vendor UUID types start at this index (128-bit).
const UUID_UNKNOWN = 0x0000 // Reserved UUID.
const UUID_VS_COUNT_DEFAULT = 10 // Default VS UUID count.
const UUID_VS_COUNT_MAX = 254 // Maximum VS UUID count.
Variables ¶
This section is empty.
Functions ¶
func AddGATTSCharacteristic ¶
func AddGATTSCharacteristic(service_handle uint16, char_md *GATTSCharMd, attr_char_value *GATTSAttr, handles *GATTSCharHandles) uint32
Add a characteristic.
func AddGATTSDescriptor ¶
Add a generic attribute.
func AddGATTSInclude ¶
Add an included service.
func AddGATTSService ¶
Add a service.
func AuthenticateGAP ¶
Initiate Pairing/Bonding.
func ChangedGATTSService ¶
Perform a Service Changed Indication to one or more peers.
func ConfigureGAPAdvSet ¶
func ConfigureGAPAdvSet(adv_handle *uint8, adv_data *GAPAdvData, adv_params *GAPAdvParams) uint32
Configure an advertising set.
func ConfirmGATTCHv ¶
Handle Value Confirmation.
func ConnectGAP ¶
func ConnectGAP(peer_addr *GAPAddr, scan_params *GAPScanParams, conn_params *GAPConnParams, conn_cfg_tag uint8) uint32
Connect.
func ControlL2capChFlow ¶
func ControlL2capChFlow(conn_handle uint16, local_cid uint16, credits uint16, credits *uint16) uint32
Advanced SDU reception flow control.
func DecodeUUID ¶
Decode UUID bytes.
func DisconnectGAP ¶
Disconnect.
func DiscoverGATTCAttrInfo ¶
func DiscoverGATTCAttrInfo(conn_handle uint16, handle_range *GATTCHandleRange) uint32
Attribute Information Discovery.
func DiscoverGATTCCharacteristics ¶
func DiscoverGATTCCharacteristics(conn_handle uint16, handle_range *GATTCHandleRange) uint32
Characteristic Discovery.
func DiscoverGATTCDescriptors ¶
func DiscoverGATTCDescriptors(conn_handle uint16, handle_range *GATTCHandleRange) uint32
Characteristic Descriptor Discovery.
func DiscoverGATTCPrimaryServices ¶
Primary Service Discovery.
func DiscoverGATTCRelationships ¶
func DiscoverGATTCRelationships(conn_handle uint16, handle_range *GATTCHandleRange) uint32
Relationship Discovery.
func EncodeUUID ¶
Encode UUID bytes.
func EncryptGAP ¶
func EncryptGAP(conn_handle uint16, master_id *GAPMasterId, enc_info *GAPEncInfo) uint32
Initiate encryption procedure.
func GetGAPAdvAddr ¶
Get the Address used on air while Advertising.
func GetGAPConnSec ¶
func GetGAPConnSec(conn_handle uint16, conn_sec *GAPConnSec) uint32
Obtain connection security level.
func GetGAPLescOobData ¶
func GetGAPLescOobData(conn_handle uint16, pk_own *GAPLescP256Pk, oobd_own *GAPLescOobData) uint32
Get the local LE Secure Connections OOB data.
func GetGAPNextConnEvtCounter ¶
Get the next connection event counter.
func GetGAPPrivacy ¶
func GetGAPPrivacy(privacy_params *GAPPrivacyParams) uint32
Get Privacy settings
func GetGAPRssi ¶
Get the last RSSI sample.
func GetGATTSAttr ¶
Retrieve the UUID and/or metadata of an attribute.
func GetGATTSInitialUserHandle ¶
Retrieve the first valid user handle.
func GetGATTSSysAttr ¶
Retrieve the persistent system attributes.
func GetGATTSValue ¶
func GetGATTSValue(conn_handle uint16, handle uint16, value *GATTSValue) uint32
Get an attribute value.
func GetVersion ¶
Get the local version information (company ID, Link Layer Version, Link Layer Subversion).
func HvxGATTS ¶
func HvxGATTS(conn_handle uint16, hvx_params *GATTSHvxParams) uint32
Handle Value Notification or Indication.
func NotifyGAPKeypress ¶
Notify of a keypress during an authentication procedure.
func ReadGATTCCharValueByUUID ¶
func ReadGATTCCharValueByUUID(conn_handle uint16, uuid *UUID, handle_range *GATTCHandleRange) uint32
Read Characteristic Value by UUID.
func ReadGATTCCharValues ¶
Read multiple Characteristic Values.
func ReleaseL2capCh ¶
Release an L2CAP channel.
func ReplyGAPAuthKey ¶
Reply with an authentication key.
func ReplyGAPLescDhkey ¶
func ReplyGAPLescDhkey(conn_handle uint16, dhkey *GAPLescDhkey) uint32
Reply with an LE Secure Connections DHKey.
func ReplyGAPSecInfo ¶
func ReplyGAPSecInfo(conn_handle uint16, enc_info *GAPEncInfo, id_info *GAPIrk, sign_info *GAPSignInfo) uint32
Reply with Security Information.
func ReplyGAPSecParams ¶
func ReplyGAPSecParams(conn_handle uint16, sec_status uint8, sec_params *GAPSecParams, sec_keyset *GAPSecKeyset) uint32
Reply with Security Parameters.
func ReplyGATTSExchangeMtu ¶
Reply to Exchange MTU Request.
func ReplyGATTSRwAuthorize ¶
func ReplyGATTSRwAuthorize(conn_handle uint16, rw_authorize_reply_params *GATTSRwAuthorizeReplyParams) uint32
Reply to an authorization request for a read or write operation on one or more attributes.
func ReplyUserMem ¶
func ReplyUserMem(conn_handle uint16, block *UserMemBlock) uint32
User Memory Reply.
func RequestGATTCExchangeMtu ¶
Exchange MTU Request.
func SetGAPDeviceIdentities ¶
Set device identity list.
func SetGAPDeviceName ¶
Set Device Name.
func SetGAPLescOobData ¶
func SetGAPLescOobData(conn_handle uint16, oobd_own *GAPLescOobData, oobd_peer *GAPLescOobData) uint32
Set the remote LE Secure Connections OOB data.
func SetGAPPrivacy ¶
func SetGAPPrivacy(privacy_params *GAPPrivacyParams) uint32
Set Privacy settings
func SetGAPTxPower ¶
Set TX Power.
func SetGAPWhitelist ¶
Set active whitelist.
func SetGATTSSysAttr ¶
Set the persistent system attributes for a connection.
func SetGATTSValue ¶
func SetGATTSValue(conn_handle uint16, handle uint16, value *GATTSValue) uint32
Set an attribute value.
func SetupL2capCh ¶
func SetupL2capCh(conn_handle uint16, local_cid *uint16, params *L2capChSetupParams) uint32
Set up an L2CAP channel.
func StartGAPConnEvtTrigger ¶
func StartGAPConnEvtTrigger(conn_handle uint16, params *GAPConnEventTrigger) uint32
Start triggering a given task on connection event start.
func StartGAPQosChannelSurvey ¶
Start Quality of Service (QoS) channel survey module.
func StartGAPRssi ¶
Start reporting of changes in RSSI.
func StartGAPScan ¶
Start Scanning.
func StopGAPConnEvtTrigger ¶
Stop triggering the task configured using @ref sd_ble_gap_conn_evt_trigger_start.
func StopGAPQosChannelSurvey ¶
func StopGAPQosChannelSurvey() uint32
Stop Quality of Service (QoS) channel survey module.
func UpdateGAPConnParam ¶
func UpdateGAPConnParam(conn_handle uint16, conn_params *GAPConnParams) uint32
Connection Parameter Update.
func UpdateGAPDataLength ¶
func UpdateGAPDataLength(conn_handle uint16, dl_params *GAPDataLengthParams, dl_limitation *GAPDataLengthLimitation) uint32
Initiate or respond to a Data Length Update Procedure.
func UpdateGAPPhy ¶
Initiate or respond to a PHY Update Procedure.
func WriteGATTC ¶
func WriteGATTC(conn_handle uint16, write_params *GATTCWriteParams) uint32
Generic write.
Types ¶
type CommonCfgVSUUID ¶
type CommonCfgVSUUID struct {
VSUUIDCount uint8 // Number of 128-bit Vendor Specific base UUID bases to allocate memory for. Default value is @ref BLE_UUID_VS_COUNT_DEFAULT. Maximum value is @ref BLE_UUID_VS_COUNT_MAX.
}
type CommonOptPALNA ¶
type CommonOptPALNA struct { PACfg PALNACfg // Power Amplifier configuration LNACfg PALNACfg // Low Noise Amplifier configuration PPIChIdSet uint8 // PPI channel used for radio pin setting PPIChIdClr uint8 // PPI channel used for radio pin clearing GPIOTEChId uint8 // GPIOTE channel used for radio pin toggling }
type EvtUserMemRelease ¶
type EvtUserMemRelease struct { Typ uint8 // User memory type, see @ref BLE_USER_MEM_TYPES. MemBlock UserMemBlock // User memory block }
type EvtUserMemRequest ¶
type EvtUserMemRequest struct {
Typ uint8 // User memory type, see @ref BLE_USER_MEM_TYPES.
}
type GAPAdvData ¶
type GAPAdvData struct { AdvData Data // Advertising data. @note Advertising data can only be specified for a @ref ble_gap_adv_properties_t::type that is allowed to contain advertising data. ScanRspData Data // Scan response data. @note Scan response data can only be specified for a @ref ble_gap_adv_properties_t::type that is scannable. }
type GAPAuxPointer ¶
type GAPCfgCarInclCfg ¶
type GAPCfgCarInclCfg struct {
IncludeCfg uint8 // Inclusion configuration of the Central Address Resolution characteristic. See @ref BLE_GAP_CHAR_INCL_CONFIG. Default is @ref BLE_GAP_CAR_INCL_CONFIG_DEFAULT.
}
type GAPCfgPpcpInclCfg ¶
type GAPCfgPpcpInclCfg struct {
IncludeCfg uint8 // Inclusion configuration of the Peripheral Preferred Connection Parameters characteristic. See @ref BLE_GAP_CHAR_INCL_CONFIG. Default is @ref BLE_GAP_PPCP_INCL_CONFIG_DEFAULT.
}
type GAPConnCfg ¶
type GAPConnCfg struct { ConnCount uint8 // The number of concurrent connections the application can create with this configuration. The default and minimum value is @ref BLE_GAP_CONN_COUNT_DEFAULT. EventLength uint16 // The time set aside for this connection on every connection interval in 1.25 ms units. The default value is @ref BLE_GAP_EVENT_LENGTH_DEFAULT, the minimum value is @ref BLE_GAP_EVENT_LENGTH_MIN. The event length and the connection interval are the primary parameters for setting the throughput of a connection. See the SoftDevice Specification for details on throughput. }
type GAPConnEventTrigger ¶
type GAPConnEventTrigger struct { PPIChId uint8 // PPI channel to use. This channel should be regarded as reserved until connection event PPI task triggering is stopped. The PPI channel ID can not be one of the PPI channels reserved by the SoftDevice. See @ref NRF_SOC_SD_PPI_CHANNELS_SD_ENABLED_MSK. TaskEndpoint uint32 // Task Endpoint to trigger. ConnEvtCounterStart uint16 // The connection event on which the task triggering should start. PeriodInEvents uint16 // Trigger period. Valid range is [1, 32767]. If the device is in slave role and slave latency is enabled, this parameter should be set to a multiple of (slave latency + 1) to ensure low power operation. }
type GAPConnParams ¶
type GAPConnParams struct { MinConnInterval uint16 // Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS. MaxConnInterval uint16 // Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS. SlaveLatency uint16 // Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS. ConnSupTimeout uint16 // Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS. }
type GAPConnSec ¶
type GAPConnSec struct { SecMode GAPConnSecMode // Currently active security mode for this connection. EncrKeySize uint8 // Length of currently active encryption key, 7 to 16 octets (only applicable for bonding procedures). }
type GAPDataLengthLimitation ¶
type GAPDataLengthLimitation struct { TxPayloadLimitedOctets uint16 // If > 0, the requested TX packet length is too long by this many octets. RxPayloadLimitedOctets uint16 // If > 0, the requested RX packet length is too long by this many octets. TxRxTimeLimitedUs uint16 // If > 0, the requested combination of TX and RX packet lengths is too long by this many microseconds. }
type GAPDataLengthParams ¶
type GAPDataLengthParams struct { MaxTxOctets uint16 // Maximum number of payload octets that a Controller supports for transmission of a single Link Layer Data Channel PDU. MaxRxOctets uint16 // Maximum number of payload octets that a Controller supports for reception of a single Link Layer Data Channel PDU. MaxTxTimeUs uint16 // Maximum time, in microseconds, that a Controller supports for transmission of a single Link Layer Data Channel PDU. MaxRxTimeUs uint16 // Maximum time, in microseconds, that a Controller supports for reception of a single Link Layer Data Channel PDU. }
type GAPEncKey ¶
type GAPEncKey struct { EncInfo GAPEncInfo // Encryption Information. MasterId GAPMasterId // Master Identification. }
type GAPEvtAdvSetTerminated ¶
type GAPEvtAdvSetTerminated struct { Reason uint8 // Reason for why the advertising set terminated. See @ref BLE_GAP_EVT_ADV_SET_TERMINATED_REASON. AdvHandle uint8 // Advertising handle in which advertising has ended. NumCompletedAdvEvents uint8 // If @ref ble_gap_adv_params_t::max_adv_evts was not set to 0, this field indicates the number of completed advertising events. AdvData GAPAdvData // Advertising buffers corresponding to the terminated advertising set. The advertising buffers provided in @ref sd_ble_gap_adv_set_configure are now released. }
type GAPEvtAuthKeyRequest ¶
type GAPEvtAuthKeyRequest struct {
KeyType uint8 // See @ref BLE_GAP_AUTH_KEY_TYPES.
}
type GAPEvtConnParamUpdate ¶
type GAPEvtConnParamUpdate struct {
ConnParams GAPConnParams // GAP Connection Parameters.
}
type GAPEvtConnParamUpdateRequest ¶
type GAPEvtConnParamUpdateRequest struct {
ConnParams GAPConnParams // GAP Connection Parameters.
}
type GAPEvtConnSecUpdate ¶
type GAPEvtConnSecUpdate struct {
ConnSec GAPConnSec // Connection security level.
}
type GAPEvtConnected ¶
type GAPEvtConnected struct { PeerAddr GAPAddr // Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1 and the address is the device's identity address. Role uint8 // BLE role for this connection, see @ref BLE_GAP_ROLES ConnParams GAPConnParams // GAP Connection Parameters. AdvHandle uint8 // Advertising handle in which advertising has ended. This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH. AdvData GAPAdvData // Advertising buffers corresponding to the terminated advertising set. The advertising buffers provided in @ref sd_ble_gap_adv_set_configure are now released. This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH. }
type GAPEvtDataLengthUpdate ¶
type GAPEvtDataLengthUpdate struct {
EffectiveParams GAPDataLengthParams // The effective data length parameters.
}
type GAPEvtDataLengthUpdateRequest ¶
type GAPEvtDataLengthUpdateRequest struct {
PeerParams GAPDataLengthParams // Peer data length parameters.
}
type GAPEvtDisconnected ¶
type GAPEvtDisconnected struct {
Reason uint8 // HCI error code, see @ref BLE_HCI_STATUS_CODES.
}
type GAPEvtKeyPressed ¶
type GAPEvtKeyPressed struct {
KpNot uint8 // Keypress notification type, see @ref BLE_GAP_KP_NOT_TYPES.
}
type GAPEvtPhyUpdate ¶
type GAPEvtPhyUpdateRequest ¶
type GAPEvtPhyUpdateRequest struct {
PeerPreferredPhys GAPPhys // The PHYs the peer prefers to use.
}
type GAPEvtQosChannelSurveyReport ¶
type GAPEvtQosChannelSurveyReport struct {
ChannelEnergy [GAP_CHANNEL_COUNT]int8 // The measured energy on the Bluetooth Low Energy channels, in dBm, indexed by Channel Index. If no measurement is available for the given channel, channel_energy is set to @ref BLE_GAP_POWER_LEVEL_INVALID.
}
type GAPEvtRssiChanged ¶
type GAPEvtScanReqReport ¶
type GAPEvtScanReqReport struct { AdvHandle uint8 // Advertising handle for the advertising set which received the Scan Request Rssi int8 // Received Signal Strength Indication in dBm. @note ERRATA-153 requires the rssi sample to be compensated based on a temperature measurement. PeerAddr GAPAddr // Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1 and the address is the device's identity address. }
type GAPEvtSecParamsRequest ¶
type GAPEvtSecParamsRequest struct {
PeerParams GAPSecParams // Initiator Security Parameters.
}
type GAPIdKey ¶
type GAPIdKey struct { IdInfo GAPIrk // Identity Resolving Key. IdAddrInfo GAPAddr // Identity Address. }
type GAPIrk ¶
type GAPIrk struct {
Irk [GAP_SEC_KEY_LEN]uint8 // Array containing IRK.
}
type GAPLescDhkey ¶
type GAPLescDhkey struct {
Key [GAP_LESC_DHKEY_LEN]uint8 // LE Secure Connections Elliptic Curve Diffie-Hellman Key. Stored in little-endian.
}
type GAPLescOobData ¶
type GAPLescOobData struct { Addr GAPAddr // Bluetooth address of the device. R [GAP_SEC_KEY_LEN]uint8 // Random Number. C [GAP_SEC_KEY_LEN]uint8 // Confirm Value. }
type GAPLescP256Pk ¶
type GAPLescP256Pk struct {
Pk [GAP_LESC_P256_PK_LEN]uint8 // LE Secure Connections Elliptic Curve Diffie-Hellman P-256 Public Key. Stored in the standard SMP protocol format: {X,Y} both in little-endian.
}
type GAPMasterId ¶
type GAPMasterId struct { Ediv uint16 // Encrypted Diversifier. Rand [GAP_SEC_RAND_LEN]uint8 // Random Number. }
type GAPOptChMap ¶
type GAPOptLocalConnLatency ¶
type GAPOptPasskey ¶
type GAPOptPasskey struct {
Passkey *uint8 // Pointer to 6-digit ASCII string (digit 0..9 only, no NULL termination) passkey to be used during pairing. If this is NULL, the SoftDevice will generate a random passkey if required.
}
type GAPPrivacyParams ¶
type GAPPrivacyParams struct { PrivacyMode uint8 // Privacy mode, see @ref BLE_GAP_PRIVACY_MODES. Default is @ref BLE_GAP_PRIVACY_MODE_OFF. PrivateAddrType uint8 // The private address type must be either @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE or @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE. PrivateAddrCycleS uint16 // Private address cycle interval in seconds. Providing an address cycle value of 0 will use the default value defined by @ref BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S. DeviceIrk *GAPIrk // When used as input, pointer to IRK structure that will be used as the default IRK. If NULL, the device default IRK will be used. When used as output, pointer to IRK structure where the current default IRK will be written to. If NULL, this argument is ignored. By default, the default IRK is used to generate random private resolvable addresses for the local device unless instructed otherwise. }
type GAPSecKeys ¶
type GAPSecKeys struct { EncKey *GAPEncKey // Encryption Key, or NULL. IdKey *GAPIdKey // Identity Key, or NULL. SignKey *GAPSignInfo // Signing Key, or NULL. Pk *GAPLescP256Pk // LE Secure Connections P-256 Public Key. When in debug mode the application must use the value defined in the Core Bluetooth Specification v4.2 Vol.3, Part H, Section 2.3.5.6.1 }
type GAPSecKeyset ¶
type GAPSecKeyset struct { KeysOwn GAPSecKeys // Keys distributed by the local device. For LE Secure Connections the encryption key will be generated locally and will always be stored if bonding. KeysPeer GAPSecKeys // Keys distributed by the remote device. For LE Secure Connections, p_enc_key must always be NULL. }
type GAPSignInfo ¶
type GAPSignInfo struct {
Csrk [GAP_SEC_KEY_LEN]uint8 // Connection Signature Resolving Key.
}
type GATTCAttrInfo128 ¶
type GATTCAttrInfo16 ¶
type GATTCConnCfg ¶
type GATTCConnCfg struct {
WriteCmdTxQueueSize uint8 // The guaranteed minimum number of Write without Response that can be queued for transmission. The default value is @ref BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT
}
type GATTCEvtCharDiscRsp ¶
type GATTCEvtCharDiscRsp struct { Count uint16 // Characteristic count. Chars [1]GATTCChar // Characteristic data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. }
type GATTCEvtCharValByUUIDReadRsp ¶
type GATTCEvtCharValByUUIDReadRsp struct { Count uint16 // Handle-Value Pair Count. ValueLen uint16 // Length of the value in Handle-Value(s) list. HandleValue [1]uint8 // Handle-Value(s) list. To iterate through the list use @ref sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. }
type GATTCEvtCharValsReadRsp ¶
type GATTCEvtCharValsReadRsp struct { Len uint16 // Concatenated Attribute values length. Values [1]uint8 // Attribute values. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. }
type GATTCEvtDescDiscRsp ¶
type GATTCEvtDescDiscRsp struct { Count uint16 // Descriptor count. Descs [1]GATTCDesc // Descriptor data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. }
type GATTCEvtExchangeMtuRsp ¶
type GATTCEvtExchangeMtuRsp struct {
ServerRxMtu uint16 // Server RX MTU size.
}
type GATTCEvtHvx ¶
type GATTCEvtHvx struct { Handle uint16 // Handle to which the HVx operation applies. Typ uint8 // Indication or Notification, see @ref BLE_GATT_HVX_TYPES. Len uint16 // Attribute data length. Data [1]uint8 // Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. }
type GATTCEvtPrimSrvcDiscRsp ¶
type GATTCEvtPrimSrvcDiscRsp struct { Count uint16 // Service count. Services [1]GATTCService // Service data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. }
type GATTCEvtReadRsp ¶
type GATTCEvtReadRsp struct { Handle uint16 // Attribute Handle. Offset uint16 // Offset of the attribute data. Len uint16 // Attribute data length. Data [1]uint8 // Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. }
type GATTCEvtRelDiscRsp ¶
type GATTCEvtRelDiscRsp struct { Count uint16 // Include count. Includes [1]GATTCInclude // Include data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. }
type GATTCEvtTimeout ¶
type GATTCEvtTimeout struct {
Src uint8 // Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES.
}
type GATTCEvtWriteCmdTxComplete ¶
type GATTCEvtWriteCmdTxComplete struct {
Count uint8 // Number of write without response transmissions completed.
}
type GATTCEvtWriteRsp ¶
type GATTCEvtWriteRsp struct { Handle uint16 // Attribute Handle. WriteOp uint8 // Type of write operation, see @ref BLE_GATT_WRITE_OPS. Offset uint16 // Data offset. Len uint16 // Data length. Data [1]uint8 // Data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. }
type GATTCHandleRange ¶
type GATTCHandleValue ¶
type GATTCInclude ¶
type GATTCInclude struct { Handle uint16 // Include Handle. IncludedSrvc GATTCService // Handle of the included service. }
type GATTCService ¶
type GATTCService struct { UUID UUID // Service UUID. HandleRange GATTCHandleRange // Service Handle Range. }
type GATTCWriteParams ¶
type GATTCWriteParams struct { WriteOp uint8 // Write Operation to be performed, see @ref BLE_GATT_WRITE_OPS. Flags uint8 // Flags, see @ref BLE_GATT_EXEC_WRITE_FLAGS. Handle uint16 // Handle to the attribute to be written. Offset uint16 // Offset in bytes. @note For WRITE_CMD and WRITE_REQ, offset must be 0. Len uint16 // Length of data in bytes. Value *uint8 // Pointer to the value data. }
type GATTConnCfg ¶
type GATTConnCfg struct {
AttMtu uint16 // Maximum size of ATT packet the SoftDevice can send or receive. The default and minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT. @mscs @mmsc{@ref BLE_GATTC_MTU_EXCHANGE} @mmsc{@ref BLE_GATTS_MTU_EXCHANGE} @endmscs
}
type GATTSAttr ¶
type GATTSAttr struct { UUID *UUID // Pointer to the attribute UUID. AttrMd *GATTSAttrMd // Pointer to the attribute metadata structure. InitLen uint16 // Initial attribute value length in bytes. InitOffs uint16 // Initial attribute value offset in bytes. If different from zero, the first init_offs bytes of the attribute value will be left uninitialized. MaxLen uint16 // Maximum attribute value length in bytes, see @ref BLE_GATTS_ATTR_LENS_MAX for maximum values. Value *uint8 // Pointer to the attribute data. Please note that if the @ref BLE_GATTS_VLOC_USER value location is selected in the attribute metadata, this will have to point to a buffer that remains valid through the lifetime of the attribute. This excludes usage of automatic variables that may go out of scope or any other temporary location. The stack may access that memory directly without the application's knowledge. For writable characteristics, this value must not be a location in flash memory. }
type GATTSCfgAttrTabSize ¶
type GATTSCfgAttrTabSize struct {
AttrTabSize uint32 // Attribute table size. Default is @ref BLE_GATTS_ATTR_TAB_SIZE_DEFAULT, minimum is @ref BLE_GATTS_ATTR_TAB_SIZE_MIN.
}
type GATTSCharHandles ¶
type GATTSCharHandles struct { ValueHandle uint16 // Handle to the characteristic value. UserDescHandle uint16 // Handle to the User Description descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. CccdHandle uint16 // Handle to the Client Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. SccdHandle uint16 // Handle to the Server Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. }
type GATTSCharMd ¶
type GATTSCharMd struct { CharProps GATTCharProps // Characteristic Properties. CharExtProps GATTCharExtProps // Characteristic Extended Properties. CharUserDesc *uint8 // Pointer to a UTF-8 encoded string (non-NULL terminated), NULL if the descriptor is not required. CharUserDescMaxSize uint16 // The maximum size in bytes of the user description descriptor. CharUserDescSize uint16 // The size of the user description, must be smaller or equal to char_user_desc_max_size. CharPf *GATTSCharPf // Pointer to a presentation format structure or NULL if the CPF descriptor is not required. UserDescMd *GATTSAttrMd // Attribute metadata for the User Description descriptor, or NULL for default values. CccdMd *GATTSAttrMd // Attribute metadata for the Client Characteristic Configuration Descriptor, or NULL for default values. SccdMd *GATTSAttrMd // Attribute metadata for the Server Characteristic Configuration Descriptor, or NULL for default values. }
type GATTSCharPf ¶
type GATTSCharPf struct { Format uint8 // Format of the value, see @ref BLE_GATT_CPF_FORMATS. Exponent int8 // Exponent for integer data types. Unit uint16 // Unit from Bluetooth Assigned Numbers. NameSpace uint8 // Namespace from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES. Desc uint16 // Namespace description from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES. }
type GATTSConnCfg ¶
type GATTSConnCfg struct {
HvnTxQueueSize uint8 // Minimum guaranteed number of Handle Value Notifications that can be queued for transmission. The default value is @ref BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT
}
type GATTSEvtExchangeMtuRequest ¶
type GATTSEvtExchangeMtuRequest struct {
ClientRxMtu uint16 // Client RX MTU size.
}
type GATTSEvtHvc ¶
type GATTSEvtHvc struct {
Handle uint16 // Attribute Handle.
}
type GATTSEvtHvnTxComplete ¶
type GATTSEvtHvnTxComplete struct {
Count uint8 // Number of notification transmissions completed.
}
type GATTSEvtRead ¶
type GATTSEvtSysAttrMissing ¶
type GATTSEvtSysAttrMissing struct {
Hint uint8 // Hint (currently unused).
}
type GATTSEvtTimeout ¶
type GATTSEvtTimeout struct {
Src uint8 // Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES.
}
type GATTSEvtWrite ¶
type GATTSEvtWrite struct { Handle uint16 // Attribute Handle. UUID UUID // Attribute UUID. Op uint8 // Type of write operation, see @ref BLE_GATTS_OPS. AuthRequired uint8 // Writing operation deferred due to authorization requirement. Application may use @ref sd_ble_gatts_value_set to finalize the writing operation. Offset uint16 // Offset for the write operation. Len uint16 // Length of the received data. Data [1]uint8 // Received data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. }
type GATTSHvxParams ¶
type GATTSHvxParams struct { Handle uint16 // Characteristic Value Handle. Typ uint8 // Indication or Notification, see @ref BLE_GATT_HVX_TYPES. Offset uint16 // Offset within the attribute value. Len *uint16 // Length in bytes to be written, length in bytes written after return. Data *uint8 // Actual data content, use NULL to use the current attribute value. }
type GATTSValue ¶
type GATTSValue struct { Len uint16 // Length in bytes to be written or read. Length in bytes written or read after successful return. Offset uint16 // Attribute value offset. Value *uint8 // Pointer to where value is stored or will be stored. If value is stored in user memory, only the attribute length is updated when p_value == NULL. Set to NULL when reading to obtain the complete length of the attribute value }
type L2capChRxParams ¶
type L2capChRxParams struct { RxMtu uint16 // The maximum L2CAP SDU size, in bytes, that L2CAP shall be able to receive on this L2CAP channel. - Must be equal to or greater than @ref BLE_L2CAP_MTU_MIN. RxMps uint16 // The maximum L2CAP PDU payload size, in bytes, that L2CAP shall be able to receive on this L2CAP channel. - Must be equal to or greater than @ref BLE_L2CAP_MPS_MIN. - Must be equal to or less than @ref ble_l2cap_conn_cfg_t::rx_mps. SduBuf Data // SDU data buffer for reception. - If @ref ble_data_t::p_data is non-NULL, initial credits are issued to the peer. - If @ref ble_data_t::p_data is NULL, no initial credits are issued to the peer. }
type L2capChSetupParams ¶
type L2capChSetupParams struct { RxParams L2capChRxParams // L2CAP channel RX parameters. LePsm uint16 // LE Protocol/Service Multiplexer. Used when requesting setup of an L2CAP channel, ignored otherwise. Status uint16 // Status code, see @ref BLE_L2CAP_CH_STATUS_CODES. Used when replying to a setup request of an L2CAP channel, ignored otherwise. }
type L2capChTxParams ¶
type L2capChTxParams struct { TxMtu uint16 // The maximum L2CAP SDU size, in bytes, that L2CAP is able to transmit on this L2CAP channel. PeerMps uint16 // The maximum L2CAP PDU payload size, in bytes, that the peer is able to receive on this L2CAP channel. TxMps uint16 // The maximum L2CAP PDU payload size, in bytes, that L2CAP is able to transmit on this L2CAP channel. This is effective tx_mps, selected by the SoftDevice as MIN( @ref ble_l2cap_ch_tx_params_t::peer_mps, @ref ble_l2cap_conn_cfg_t::tx_mps ) Credits uint16 // Initial credits given by the peer. }
type L2capConnCfg ¶
type L2capConnCfg struct { RxMps uint16 // The maximum L2CAP PDU payload size, in bytes, that L2CAP shall be able to receive on L2CAP channels on connections with this configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN. TxMps uint16 // The maximum L2CAP PDU payload size, in bytes, that L2CAP shall be able to transmit on L2CAP channels on connections with this configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN. RxQueueSize uint8 // Number of SDU data buffers that can be queued for reception per L2CAP channel. The minimum value is one. TxQueueSize uint8 // Number of SDU data buffers that can be queued for transmission per L2CAP channel. The minimum value is one. ChCount uint8 // Number of L2CAP channels the application can create per connection with this configuration. The default value is zero, the maximum value is @ref BLE_L2CAP_CH_COUNT_MAX. @note if this parameter is set to zero, all other parameters in @ref ble_l2cap_conn_cfg_t are ignored. }
type L2capEvtChCredit ¶
type L2capEvtChCredit struct {
Credits uint16 // Additional credits given by the peer.
}
type L2capEvtChRx ¶
type L2capEvtChSduBufReleased ¶
type L2capEvtChSduBufReleased struct {
SduBuf Data // Returned reception or transmission SDU data buffer. The SoftDevice returns SDU data buffers supplied by the application, which have not yet been returned previously via a @ref BLE_L2CAP_EVT_CH_RX or @ref BLE_L2CAP_EVT_CH_TX event.
}
type L2capEvtChSetup ¶
type L2capEvtChSetup struct {
TxParams L2capChTxParams // L2CAP channel TX parameters.
}
type L2capEvtChSetupRefused ¶
type L2capEvtChSetupRequest ¶
type L2capEvtChSetupRequest struct { TxParams L2capChTxParams // L2CAP channel TX parameters. LePsm uint16 // LE Protocol/Service Multiplexer. }
type L2capEvtChTx ¶
type L2capEvtChTx struct {
SduBuf Data // SDU data buffer.
}
type UserMemBlock ¶
type Version ¶
type Version struct { VersionNumber uint8 // Link Layer Version number. See https://www.bluetooth.org/en-us/specification/assigned-numbers/link-layer for assigned values. CompanyId uint16 // Company ID, Nordic Semiconductor's company ID is 89 (0x0059) (https://www.bluetooth.org/apps/content/Default.aspx?doc_id=49708). SubversionNumber uint16 // Link Layer Sub Version number, corresponds to the SoftDevice Config ID or Firmware ID (FWID). }