upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
acilib_if.h
Go to the documentation of this file.
1 /* Copyright (c) 2014, Nordic Semiconductor ASA
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to deal
5  * in the Software without restriction, including without limitation the rights
6  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7  * copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in all
11  * copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19  * SOFTWARE.
20  */
21 
30 #ifndef _acilib_IF_H_
31 #define _acilib_IF_H_
32 
40 void acil_encode_cmd_set_test_mode(uint8_t *buffer, aci_cmd_params_test_t *p_aci_cmd_params_test);
41 
48 void acil_encode_cmd_sleep(uint8_t *buffer);
49 
56 void acil_encode_cmd_get_device_version(uint8_t *buffer);
57 
66 void acil_encode_cmd_set_local_data(uint8_t *buffer, aci_cmd_params_set_local_data_t *p_aci_cmd_params_set_local_data, uint8_t data_size);
67 
75 void acil_encode_cmd_connect(uint8_t *buffer, aci_cmd_params_connect_t *p_aci_cmd_params_connect);
76 
84 void acil_encode_cmd_bond(uint8_t *buffer, aci_cmd_params_bond_t *p_aci_cmd_params_bond);
85 
93 void acil_encode_cmd_disconnect(uint8_t *buffer, aci_cmd_params_disconnect_t *p_aci_cmd_params_disconnect);
94 
101  void acil_encode_baseband_reset(uint8_t *buffer);
102 
109  void acil_encode_direct_connect(uint8_t *buffer);
110 
117 void acil_encode_cmd_wakeup(uint8_t *buffer);
118 
126 void acil_encode_cmd_set_radio_tx_power(uint8_t *buffer, aci_cmd_params_set_tx_power_t *p_aci_cmd_params_set_tx_power);
127 
134 void acil_encode_cmd_get_address(uint8_t *buffer);
135 
144 void acil_encode_cmd_send_data(uint8_t *buffer, aci_cmd_params_send_data_t *p_aci_cmd_params_send_data_t, uint8_t data_size);
145 
153 void acil_encode_cmd_request_data(uint8_t *buffer, aci_cmd_params_request_data_t *p_aci_cmd_params_request_data);
154 
162 void acil_encode_cmd_open_remote_pipe(uint8_t *buffer, aci_cmd_params_open_remote_pipe_t *p_aci_cmd_params_open_remote_pipe);
163 
171 void acil_encode_cmd_close_remote_pipe(uint8_t *buffer, aci_cmd_params_close_remote_pipe_t *p_aci_cmd_params_close_remote_pipe);
172 
181 void acil_encode_cmd_echo_msg(uint8_t *buffer, aci_cmd_params_echo_t *p_cmd_params_echo, uint8_t msg_size);
182 
189 void acil_encode_cmd_battery_level(uint8_t *buffer);
190 
197 void acil_encode_cmd_temparature(uint8_t *buffer);
198 
205 void acil_encode_cmd_read_dynamic_data(uint8_t *buffer);
206 
214 void acil_encode_cmd_change_timing_req(uint8_t *buffer, aci_cmd_params_change_timing_t *p_aci_cmd_params_change_timing);
215 
223 void acil_encode_cmd_change_timing_req_GAP_PPCP(uint8_t *buffer);
224 
225 
235 void acil_encode_cmd_write_dynamic_data(uint8_t *buffer, uint8_t seq_no, uint8_t* dynamic_data, uint8_t dynamic_data_size);
236 
244 void acil_encode_cmd_send_data_ack(uint8_t *buffer, const uint8_t pipe_number);
245 
254 void acil_encode_cmd_send_data_nack(uint8_t *buffer, const uint8_t pipe_number,const uint8_t error_code);
255 
263 void acil_encode_cmd_set_app_latency(uint8_t *buffer, aci_cmd_params_set_app_latency_t *p_aci_cmd_params_set_app_latency);
264 
273 void acil_encode_cmd_setup(uint8_t *buffer, aci_cmd_params_setup_t *p_aci_cmd_params_setup, uint8_t setup_data_size);
274 
282 void acil_encode_cmd_dtm_cmd(uint8_t *buffer, aci_cmd_params_dtm_cmd_t *p_aci_cmd_params_dtm_cmd);
283 
290 void acil_encode_cmd_set_key(uint8_t *buffer, aci_cmd_params_set_key_t *p_aci_cmd_params_set_key);
291 
298 void acil_encode_cmd_bond_security_request(uint8_t *buffer);
299 
308 bool acil_encode_cmd(uint8_t *buffer, aci_cmd_t *p_aci_cmd);
309 
317 void acil_encode_cmd_broadcast(uint8_t *buffer, aci_cmd_params_broadcast_t * p_aci_cmd_params_broadcast);
318 
326 void acil_encode_cmd_open_adv_pipes(uint8_t *buffer, aci_cmd_params_open_adv_pipe_t * p_aci_cmd_params_set_adv_svc_data);
327 
335 void acil_decode_evt_command_response(uint8_t *buffer_in, aci_evt_params_cmd_rsp_t *p_evt_params_cmd_rsp);
336 
344 void acil_decode_evt_device_started(uint8_t *buffer_in, aci_evt_params_device_started_t *p_evt_params_device_started);
345 
353 void acil_decode_evt_pipe_status(uint8_t *buffer_in, aci_evt_params_pipe_status_t *p_aci_evt_params_pipe_status);
354 
362 void acil_decode_evt_disconnected(uint8_t *buffer_in, aci_evt_params_disconnected_t *p_aci_evt_params_disconnected);
363 
371 void acil_decode_evt_bond_status(uint8_t *buffer_in, aci_evt_params_bond_status_t *p_aci_evt_params_bond_status);
372 
380 uint8_t acil_decode_evt_data_received(uint8_t *buffer_in, aci_evt_params_data_received_t *p_evt_params_data_received);
381 
389 void acil_decode_evt_data_ack(uint8_t *buffer_in, aci_evt_params_data_ack_t *p_evt_params_data_ack);
390 
398 uint8_t acil_decode_evt_hw_error(uint8_t *buffer_in, aci_evt_params_hw_error_t *p_aci_evt_params_hw_error);
399 
407 void acil_decode_evt_credit(uint8_t *buffer_in, aci_evt_params_data_credit_t *p_evt_params_data_credit);
408 
416 void acil_decode_evt_connected(uint8_t *buffer_in, aci_evt_params_connected_t *p_aci_evt_params_connected);
417 
425 void acil_decode_evt_timing(uint8_t *buffer_in, aci_evt_params_timing_t *p_evt_params_timing);
426 
433 void acil_decode_evt_pipe_error(uint8_t *buffer_in, aci_evt_params_pipe_error_t *p_evt_params_pipe_error);
434 
442 void acil_decode_evt_key_request(uint8_t *buffer_in, aci_evt_params_key_request_t *p_evt_params_key_request);
443 
451 uint8_t acil_decode_evt_echo(uint8_t *buffer_in, aci_evt_params_echo_t *buffer_out);
452 
460 bool acil_decode_evt(uint8_t *buffer_in, aci_evt_t *p_aci_evt);
461 
469 void acil_decode_evt_display_passkey(uint8_t *buffer_in, aci_evt_params_display_passkey_t *p_aci_evt_params_display_passkey);
470 
471 #endif /* _acilib_IF_H_ */
void acil_encode_cmd_set_radio_tx_power(uint8_t *buffer, aci_cmd_params_set_tx_power_t *p_aci_cmd_params_set_tx_power)
Encode the ACI message for set radio Tx power.
Definition: acilib.cpp:114
void acil_encode_cmd_bond(uint8_t *buffer, aci_cmd_params_bond_t *p_aci_cmd_params_bond)
Encode the ACI message to bond.
Definition: acilib.cpp:79
void acil_encode_cmd_open_remote_pipe(uint8_t *buffer, aci_cmd_params_open_remote_pipe_t *p_aci_cmd_params_open_remote_pipe)
Encode the ACI message for open remote pipe.
Definition: acilib.cpp:142
void acil_encode_cmd_connect(uint8_t *buffer, aci_cmd_params_connect_t *p_aci_cmd_params_connect)
Encode the ACI message to connect.
Definition: acilib.cpp:69
void acil_decode_evt_disconnected(uint8_t *buffer_in, aci_evt_params_disconnected_t *p_aci_evt_params_disconnected)
Decode the ACI event for disconnected.
Definition: acilib.cpp:457
void acil_decode_evt_device_started(uint8_t *buffer_in, aci_evt_params_device_started_t *p_evt_params_device_started)
Decode the ACI event device started.
Definition: acilib.cpp:444
void acil_encode_cmd_change_timing_req(uint8_t *buffer, aci_cmd_params_change_timing_t *p_aci_cmd_params_change_timing)
Encode the ACI message to change timing request.
Definition: acilib.cpp:189
void acil_decode_evt_timing(uint8_t *buffer_in, aci_evt_params_timing_t *p_evt_params_timing)
Decode the ACI event for timing.
Definition: acilib.cpp:514
void acil_encode_cmd_close_remote_pipe(uint8_t *buffer, aci_cmd_params_close_remote_pipe_t *p_aci_cmd_params_close_remote_pipe)
Encode the ACI message for close remote pipe.
Definition: acilib.cpp:149
uint8_t acil_decode_evt_echo(uint8_t *buffer_in, aci_evt_params_echo_t *buffer_out)
Decode the ACI event for echo.
Definition: acilib.cpp:537
void acil_decode_evt_display_passkey(uint8_t *buffer_in, aci_evt_params_display_passkey_t *p_aci_evt_params_display_passkey)
Decode the Display Key Event.
Definition: acilib.cpp:544
void acil_encode_cmd_get_address(uint8_t *buffer)
Encode the ACI message for get device address.
Definition: acilib.cpp:121
void acil_encode_cmd_set_key(uint8_t *buffer, aci_cmd_params_set_key_t *p_aci_cmd_params_set_key)
Encode the ACI message for Set Key Request command.
Definition: acilib.cpp:273
void acil_decode_evt_credit(uint8_t *buffer_in, aci_evt_params_data_credit_t *p_evt_params_data_credit)
Decode the ACI event data credit.
Definition: acilib.cpp:495
void acil_encode_cmd_setup(uint8_t *buffer, aci_cmd_params_setup_t *p_aci_cmd_params_setup, uint8_t setup_data_size)
Encode the ACI message for setup.
Definition: acilib.cpp:219
void acil_encode_cmd_echo_msg(uint8_t *buffer, aci_cmd_params_echo_t *p_cmd_params_echo, uint8_t msg_size)
Encode the ACI message for echo message.
Definition: acilib.cpp:156
void acil_encode_cmd_get_device_version(uint8_t *buffer)
Encode the ACI message for get device version.
Definition: acilib.cpp:55
uint8_t acil_decode_evt_data_received(uint8_t *buffer_in, aci_evt_params_data_received_t *p_evt_params_data_received)
Decode the ACI event for data received.
Definition: acilib.cpp:473
void acil_encode_baseband_reset(uint8_t *buffer)
Encode the ACI message to baseband reset.
Definition: acilib.cpp:96
uint8_t acil_decode_evt_hw_error(uint8_t *buffer_in, aci_evt_params_hw_error_t *p_aci_evt_params_hw_error)
Decode the ACI event for hardware error.
Definition: acilib.cpp:486
void acil_encode_direct_connect(uint8_t *buffer)
Encode the ACI message for Directed Advertising.
Definition: acilib.cpp:102
void acil_encode_cmd_write_dynamic_data(uint8_t *buffer, uint8_t seq_no, uint8_t *dynamic_data, uint8_t dynamic_data_size)
Encode the ACI message for write dynamic data.
Definition: acilib.cpp:181
void acil_encode_cmd_disconnect(uint8_t *buffer, aci_cmd_params_disconnect_t *p_aci_cmd_params_disconnect)
Encode the ACI message to disconnect.
Definition: acilib.cpp:89
void acil_encode_cmd_set_local_data(uint8_t *buffer, aci_cmd_params_set_local_data_t *p_aci_cmd_params_set_local_data, uint8_t data_size)
Encode the ACI message for set local data.
Definition: acilib.cpp:61
bool acil_decode_evt(uint8_t *buffer_in, aci_evt_t *p_aci_evt)
Decode the ACI event.
Definition: acilib.cpp:554
void acil_encode_cmd_temparature(uint8_t *buffer)
Encode the ACI message to temparature.
Definition: acilib.cpp:169
void acil_encode_cmd_set_app_latency(uint8_t *buffer, aci_cmd_params_set_app_latency_t *p_aci_cmd_params_set_app_latency)
Encode the ACI message to set the application latency.
Definition: acilib.cpp:203
void acil_encode_cmd_send_data(uint8_t *buffer, aci_cmd_params_send_data_t *p_aci_cmd_params_send_data_t, uint8_t data_size)
Encode the ACI message for send data.
Definition: acilib.cpp:127
void acil_encode_cmd_read_dynamic_data(uint8_t *buffer)
Encode the ACI message to read dynamic data.
Definition: acilib.cpp:175
void acil_encode_cmd_broadcast(uint8_t *buffer, aci_cmd_params_broadcast_t *p_aci_cmd_params_broadcast)
Encode the ACI message for Broadcast command.
Definition: acilib.cpp:255
void acil_encode_cmd_dtm_cmd(uint8_t *buffer, aci_cmd_params_dtm_cmd_t *p_aci_cmd_params_dtm_cmd)
Encode the ACI message for DTM command.
Definition: acilib.cpp:226
void acil_decode_evt_connected(uint8_t *buffer_in, aci_evt_params_connected_t *p_aci_evt_params_connected)
Decode the ACI event for connected.
Definition: acilib.cpp:500
void acil_encode_cmd_bond_security_request(uint8_t *buffer)
Encode the ACI message for Bond Security Request command.
Definition: acilib.cpp:249
void acil_encode_cmd_send_data_nack(uint8_t *buffer, const uint8_t pipe_number, const uint8_t error_code)
Encode the ACI message to send negative acknowledgement.
Definition: acilib.cpp:241
bool acil_encode_cmd(uint8_t *buffer, aci_cmd_t *p_aci_cmd)
Encode the ACI message.
Definition: acilib.cpp:300
void acil_encode_cmd_request_data(uint8_t *buffer, aci_cmd_params_request_data_t *p_aci_cmd_params_request_data)
Encode the ACI message for request data.
Definition: acilib.cpp:135
void acil_decode_evt_bond_status(uint8_t *buffer_in, aci_evt_params_bond_status_t *p_aci_evt_params_bond_status)
Decode the ACI event for bond status.
Definition: acilib.cpp:463
void acil_decode_evt_pipe_status(uint8_t *buffer_in, aci_evt_params_pipe_status_t *p_aci_evt_params_pipe_status)
Decode the ACI event pipe status.
Definition: acilib.cpp:451
void acil_decode_evt_command_response(uint8_t *buffer_in, aci_evt_params_cmd_rsp_t *p_evt_params_cmd_rsp)
Decode the ACI event command response.
Definition: acilib.cpp:384
void acil_encode_cmd_wakeup(uint8_t *buffer)
Encode the ACI message to wakeup.
Definition: acilib.cpp:108
void acil_decode_evt_key_request(uint8_t *buffer_in, aci_evt_params_key_request_t *p_evt_params_key_request)
Decode the ACI event for key request.
Definition: acilib.cpp:532
void acil_decode_evt_data_ack(uint8_t *buffer_in, aci_evt_params_data_ack_t *p_evt_params_data_ack)
Decode the ACI event data acknowledgement.
Definition: acilib.cpp:481
void acil_encode_cmd_open_adv_pipes(uint8_t *buffer, aci_cmd_params_open_adv_pipe_t *p_aci_cmd_params_set_adv_svc_data)
Encode the ACI message for Open Adv Pipes.
Definition: acilib.cpp:265
void acil_encode_cmd_sleep(uint8_t *buffer)
Encode the ACI message for sleep command.
Definition: acilib.cpp:49
void acil_encode_cmd_set_test_mode(uint8_t *buffer, aci_cmd_params_test_t *p_aci_cmd_params_test)
Encode the ACI message for set test mode command.
Definition: acilib.cpp:42
void acil_encode_cmd_battery_level(uint8_t *buffer)
Encode the ACI message to battery level.
Definition: acilib.cpp:163
void acil_encode_cmd_send_data_ack(uint8_t *buffer, const uint8_t pipe_number)
Encode the ACI message to send data acknowledgement.
Definition: acilib.cpp:234
void acil_encode_cmd_change_timing_req_GAP_PPCP(uint8_t *buffer)
Encode the ACI message to change timing request using the timing parameters from GAP PPCP...
Definition: acilib.cpp:212
void acil_decode_evt_pipe_error(uint8_t *buffer_in, aci_evt_params_pipe_error_t *p_evt_params_pipe_error)
Decode the ACI event for pipe error.
Definition: acilib.cpp:524