50 #define EVT_CMD_RESPONSE_MIN_LENGTH 3 52 #define PIPES_ARRAY_SIZE ((ACI_DEVICE_MAX_PIPES + 7)/8) 60 ACI_ASSERT_SIZE(hal_aci_evt_t, 34);
65 aci_pipe_type_t pipe_type;
68 typedef struct aci_setup_info_t
71 uint8_t number_of_pipes;
72 hal_aci_data_t *setup_msgs;
73 uint8_t num_setup_msgs;
89 typedef struct aci_state_t
92 aci_setup_info_t aci_setup_info;
94 uint8_t data_credit_total;
95 aci_device_operation_mode_t device_state;
100 uint8_t data_credit_available;
102 uint16_t connection_interval;
103 uint16_t slave_latency;
104 uint16_t supervision_timeout;
106 uint8_t pipes_open_bitmap[PIPES_ARRAY_SIZE];
107 uint8_t pipes_closed_bitmap[PIPES_ARRAY_SIZE];
108 bool confirmation_pending;
116 #define DISCONNECT_REASON_CX_TIMEOUT 0x08 117 #define DISCONNECT_REASON_CX_CLOSED_BY_PEER_DEVICE 0x13 118 #define DISCONNECT_REASON_POWER_LOSS 0x14 119 #define DISCONNECT_REASON_CX_CLOSED_BY_LOCAL_DEVICE 0x16 120 #define DISCONNECT_REASON_ADVERTISER_TIMEOUT 0x50 264 bool lib_aci_test(aci_test_mode_change_t enter_exit_test_mode);
287 bool lib_aci_bond(uint16_t run_timeout, uint16_t adv_interval);
409 bool lib_aci_change_timing(uint16_t minimun_cx_interval, uint16_t maximum_cx_interval, uint16_t slave_latency, uint16_t timeout);
440 bool lib_aci_send_nack(aci_state_t *aci_stat,
const uint8_t pipe,
const uint8_t error_code);
488 bool lib_aci_set_key(aci_key_type_t key_rsp_type, uint8_t *key, uint8_t len);
bool lib_aci_broadcast(const uint16_t timeout, const uint16_t adv_interval)
Sends Broadcast message to the radio.
Definition: lib_aci.cpp:641
bool lib_aci_get_address(void)
Gets the device address.
Definition: lib_aci.cpp:362
bool lib_aci_change_timing(uint16_t minimun_cx_interval, uint16_t maximum_cx_interval, uint16_t slave_latency, uint16_t timeout)
Sends a L2CAP change connection parameters request.
Definition: lib_aci.cpp:437
bool lib_aci_device_version(void)
Gets the radio's version.
Definition: lib_aci.cpp:277
uint16_t lib_aci_get_cx_interval(aci_state_t *aci_stat)
Gets the connection interval in multiple of 1.25 ms.
Definition: lib_aci.cpp:223
void lib_aci_flush(void)
Flushes the events in the ACI command queues and ACI Event queue.
Definition: lib_aci.cpp:708
uint8_t lib_aci_get_nb_available_credits(aci_state_t *aci_stat)
Gets the number of currently available ACI credits.
Definition: lib_aci.cpp:205
bool lib_aci_bond(uint16_t run_timeout, uint16_t adv_interval)
Tries to bond with a peer device.
Definition: lib_aci.cpp:336
void lib_aci_pin_reset(void)
Function to pin reset the nRF8001.
Definition: lib_aci.cpp:719
bool lib_aci_set_key(aci_key_type_t key_rsp_type, uint8_t *key, uint8_t len)
Set the key requested by the 8001.
Definition: lib_aci.cpp:510
bool lib_aci_event_get(aci_state_t *aci_stat, hal_aci_evt_t *aci_evt)
Gets an ACI event from the ACI Event Queue.
Definition: lib_aci.cpp:551
bool lib_aci_read_dynamic_data(void)
Sends ReadDynamicData command to the host.
Definition: lib_aci.cpp:686
bool lib_aci_event_peek(hal_aci_evt_t *p_aci_evt_data)
Peeks an ACI event from the ACI Event Queue.
Definition: lib_aci.cpp:546
Definitions for the ACI (Application Control Interface) commands.
bool lib_aci_wakeup(void)
Wakes up the radio.
Definition: lib_aci.cpp:346
bool lib_aci_close_remote_pipe(aci_state_t *aci_stat, uint8_t pipe)
Closes a remote pipe.
Definition: lib_aci.cpp:483
uint16_t lib_aci_get_cx_interval_ms(aci_state_t *aci_stat)
Gets the connection interval in milliseconds.
Definition: lib_aci.cpp:210
bool lib_aci_direct_connect(void)
Radio starts directed advertising to bonded device.
Definition: lib_aci.cpp:270
bool lib_aci_command_queue_full(void)
Return full status of Command queue.
Definition: lib_aci.cpp:739
bool lib_aci_send_nack(aci_state_t *aci_stat, const uint8_t pipe, const uint8_t error_code)
Sends negative acknowledgement message to peer.
Definition: lib_aci.cpp:628
bool lib_aci_disconnect(aci_state_t *aci_stat, aci_disconnect_reason_t reason)
Disconnects from peer device.
Definition: lib_aci.cpp:311
bool lib_aci_open_adv_pipes(const uint8_t *const adv_service_data_pipes)
Sends a command to the radio to set the pipes to be placed in Advertisement Service Data...
Definition: lib_aci.cpp:663
bool lib_aci_write_dynamic_data(uint8_t sequence_number, uint8_t *dynamic_data, uint8_t length)
Sends WriteDynamicData command to the host.
Definition: lib_aci.cpp:693
bool lib_aci_connect(uint16_t run_timeout, uint16_t adv_interval)
Tries to connect to a peer device.
Definition: lib_aci.cpp:301
bool lib_aci_dtm_command(uint8_t dtm_command_msbyte, uint8_t dtm_command_lsbyte)
Sends an DTM command.
Definition: lib_aci.cpp:699
bool lib_aci_change_timing_GAP_PPCP(void)
Sends a L2CAP change connection parameters request with the connection predefined preffered connectio...
Definition: lib_aci.cpp:449
bool lib_aci_test(aci_test_mode_change_t enter_exit_test_mode)
Sets the radio in test mode.
Definition: lib_aci.cpp:247
Interface for hal_aci_tl.
bool lib_aci_request_data(aci_state_t *aci_stat, uint8_t pipe)
Requests data from a given pipe.
Definition: lib_aci.cpp:410
bool lib_aci_is_discovery_finished(aci_state_t *aci_stat)
Checks if the discovery operation is finished.
Definition: lib_aci.cpp:96
bool lib_aci_bond_request(void)
Sends a SMP Security Request.
Definition: lib_aci.cpp:540
bool lib_aci_echo_msg(uint8_t message_size, uint8_t *message_data)
Sends an echo message.
Definition: lib_aci.cpp:520
bool lib_aci_radio_reset(void)
Resets the radio.
Definition: lib_aci.cpp:263
bool lib_aci_is_pipe_closed(aci_state_t *aci_stat, uint8_t pipe)
Checks if a given pipe is closed.
Definition: lib_aci.cpp:83
bool lib_aci_is_pipe_available(aci_state_t *aci_stat, uint8_t pipe)
Checks if a given pipe is available.
Definition: lib_aci.cpp:70
bool lib_aci_event_queue_full(void)
Return full status of the Event queue.
Definition: lib_aci.cpp:729
uint16_t lib_aci_get_slave_latency(aci_state_t *aci_stat)
Gets the current slave latency.
Definition: lib_aci.cpp:229
bool lib_aci_event_queue_empty(void)
Return empty status of the Event queue.
Definition: lib_aci.cpp:724
void lib_aci_debug_print(bool enable)
Function to enable printing of all ACI commands sent and ACI events received.
Definition: lib_aci.cpp:713
bool lib_aci_get_battery_level(void)
Gets the battery level.
Definition: lib_aci.cpp:376
bool lib_aci_set_app_latency(uint16_t latency, aci_app_latency_mode_t latency_mode)
Sets a given application latency.
Definition: lib_aci.cpp:235
bool lib_aci_send_ack(aci_state_t *aci_stat, const uint8_t pipe)
Sends acknowledgement message to peer.
Definition: lib_aci.cpp:616
bool lib_aci_set_tx_power(aci_device_output_power_t tx_power)
Sets the radio's TX power.
Definition: lib_aci.cpp:353
bool lib_aci_sleep(void)
Sets the radio in sleep mode.
Definition: lib_aci.cpp:256
bool lib_aci_set_local_data(aci_state_t *aci_stat, uint8_t pipe, uint8_t *value, uint8_t size)
Sets Local Data.
Definition: lib_aci.cpp:284
uint8_t location
Definition: lib_aci.h:64
bool lib_aci_send_data(uint8_t pipe, uint8_t *value, uint8_t size)
Sends data on a given pipe.
Definition: lib_aci.cpp:383
bool lib_aci_open_adv_pipe(const uint8_t pipe)
Sends a command to the radio to set the input pipe to be placed in Advertisement Service Data...
Definition: lib_aci.cpp:676
Structure for the ACI_CMD_SET_LOCAL_DATA ACI command parameters.
Definition: aci.h:271
bool lib_aci_open_remote_pipe(aci_state_t *aci_stat, uint8_t pipe)
Opens a remote pipe.
Definition: lib_aci.cpp:456
Definitions for the ACI (Application Control Interface) events.
void lib_aci_init(aci_state_t *aci_stat, bool debug)
Initialization function.
Definition: lib_aci.cpp:179
bool lib_aci_get_temperature(void)
Gets the temperature.
Definition: lib_aci.cpp:369
bool lib_aci_command_queue_empty(void)
Return empty status of Command queue.
Definition: lib_aci.cpp:734