Advertisement
Guest User

Untitled

a guest
Dec 4th, 2014
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.95 KB | None | 0 0
  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.  
  22.  
  23. /** @defgroup ble_uart_project_template ble_uart_project_template
  24. @{
  25. @ingroup projects
  26. @brief Empty project that can be used as a template for new projects.
  27.  
  28. @details
  29. This project is a firmware template for new projects.
  30. The project will run correctly in its current state.
  31. It can send data on the UART TX characteristic
  32. It can receive data on the UART RX characteristic.
  33. With this project you have a starting point for adding your own application functionality.
  34.  
  35. The following instructions describe the steps to be made on the Windows PC:
  36.  
  37. -# Install the Master Control Panel on your computer. Connect the Master Emulator
  38. (nRF2739) and make sure the hardware drivers are installed.
  39.  
  40. -# You can use the nRF UART app in the Apple iOS app store and Google Play for Android 4.3 for Samsung Galaxy S4
  41. with this UART template app
  42.  
  43. -# You can send data from the Arduino serial monitor, maximum length of a string is 19 bytes
  44. Set the line ending to "Newline" in the Serial monitor (The newline is also sent over the air
  45.  
  46. *
  47. * Click on the "Serial Monitor" button on the Arduino IDE to reset the Arduino and start the application.
  48. * The setup() function is called first and is called only once for each reset of the Arduino.
  49. * The loop() function as the name implies is called in a loop.
  50. *
  51. * The setup() and loop() function are called in this way.
  52. * main()
  53. * {
  54. * setup();
  55. * while(1)
  56. * {
  57. * loop();
  58. * }
  59. * }
  60. *
  61. */
  62. #include <SPI.h>
  63. #include <lib_aci.h>
  64. #include <aci_setup.h>
  65. #include "uart_over_ble.h"
  66.  
  67. /**
  68. Put the nRF8001 setup in the RAM of the nRF8001.
  69. */
  70. #include "services.h"
  71. //#include <stdint.h>
  72. /**
  73. Include the services_lock.h to put the setup in the OTP memory of the nRF8001.
  74. This would mean that the setup cannot be changed once put in.
  75. However this removes the need to do the setup of the nRF8001 on every reset.
  76. */
  77.  
  78.  
  79. #ifdef SERVICES_PIPE_TYPE_MAPPING_CONTENT
  80. static services_pipe_type_mapping_t
  81. services_pipe_type_mapping[NUMBER_OF_PIPES] = SERVICES_PIPE_TYPE_MAPPING_CONTENT;
  82. #else
  83. #define NUMBER_OF_PIPES 0
  84. static services_pipe_type_mapping_t * services_pipe_type_mapping = NULL;
  85. #endif
  86.  
  87. /* Store the setup for the nRF8001 in the flash of the AVR to save on RAM */
  88. static hal_aci_data_t setup_msgs[NB_SETUP_MESSAGES] PROGMEM = SETUP_MESSAGES_CONTENT;
  89.  
  90. // aci_struct that will contain
  91. // total initial credits
  92. // current credit
  93. // current state of the aci (setup/standby/active/sleep)
  94. // open remote pipe pending
  95. // close remote pipe pending
  96. // Current pipe available bitmap
  97. // Current pipe closed bitmap
  98. // Current connection interval, slave latency and link supervision timeout
  99. // Current State of the the GATT client (Service Discovery)
  100. // Status of the bond (R) Peer address
  101. static struct aci_state_t aci_state;
  102.  
  103. /*
  104. Temporary buffers for sending ACI commands
  105. */
  106. static hal_aci_evt_t aci_data;
  107. //static hal_aci_data_t aci_cmd;
  108.  
  109. /*
  110. Timing change state variable
  111. */
  112. static bool timing_change_done = false;
  113.  
  114. /*
  115. Used to test the UART TX characteristic notification
  116. */
  117. static uart_over_ble_t uart_over_ble;
  118. static uint8_t uart_buffer[20];
  119. static uint8_t uart_buffer_len = 0;
  120. static uint8_t dummychar = 0;
  121.  
  122. /*
  123. Initialize the radio_ack. This is the ack received for every transmitted packet.
  124. */
  125. //static bool radio_ack_pending = false;
  126.  
  127. /* Define how assert should function in the BLE library */
  128. void __ble_assert(const char *file, uint16_t line)
  129. {
  130. Serial.print("ERROR ");
  131. Serial.print(file);
  132. Serial.print(": ");
  133. Serial.print(line);
  134. Serial.print("\n");
  135. while(1);
  136. }
  137. /*
  138. Description:
  139.  
  140. In this template we are using the BTLE as a UART and can send and receive packets.
  141. The maximum size of a packet is 20 bytes.
  142. When a command it received a response(s) are transmitted back.
  143. Since the response is done using a Notification the peer must have opened it(subscribed to it) before any packet is transmitted.
  144. The pipe for the UART_TX becomes available once the peer opens it.
  145. See section 20.4.1 -> Opening a Transmit pipe
  146. In the master control panel, clicking Enable Services will open all the pipes on the nRF8001.
  147.  
  148. The ACI Evt Data Credit provides the radio level ack of a transmitted packet.
  149. */
  150. void setup(void)
  151. {
  152. Serial.begin(115200);
  153. //Wait until the serial port is available (useful only for the Leonardo)
  154. //As the Leonardo board is not reseted every time you open the Serial Monitor
  155. #if defined (__AVR_ATmega32U4__)
  156. while(!Serial)
  157. {}
  158. delay(5000); //5 seconds delay for enabling to see the start up comments on the serial board
  159. #elif defined(__PIC32MX__)
  160. delay(1000);
  161. #endif
  162.  
  163. Serial.println(F("Arduino setup"));
  164. Serial.println(F("Set line ending to newline to send data from the serial monitor"));
  165.  
  166. /**
  167. Point ACI data structures to the the setup data that the nRFgo studio generated for the nRF8001
  168. */
  169. if (NULL != services_pipe_type_mapping)
  170. {
  171. aci_state.aci_setup_info.services_pipe_type_mapping = &services_pipe_type_mapping[0];
  172. }
  173. else
  174. {
  175. aci_state.aci_setup_info.services_pipe_type_mapping = NULL;
  176. }
  177. aci_state.aci_setup_info.number_of_pipes = NUMBER_OF_PIPES;
  178. aci_state.aci_setup_info.setup_msgs = setup_msgs;
  179. aci_state.aci_setup_info.num_setup_msgs = NB_SETUP_MESSAGES;
  180.  
  181. /*
  182. Tell the ACI library, the MCU to nRF8001 pin connections.
  183. The Active pin is optional and can be marked UNUSED
  184. */
  185. aci_state.aci_pins.board_name = BOARD_DEFAULT; //See board.h for details REDBEARLAB_SHIELD_V1_1 or BOARD_DEFAULT
  186. aci_state.aci_pins.reqn_pin = 9; //SS for Nordic board, 9 for REDBEARLAB_SHIELD_V1_1
  187. aci_state.aci_pins.rdyn_pin = 8; //3 for Nordic board, 8 for REDBEARLAB_SHIELD_V1_1
  188. aci_state.aci_pins.mosi_pin = MOSI;
  189. aci_state.aci_pins.miso_pin = MISO;
  190. aci_state.aci_pins.sck_pin = SCK;
  191.  
  192. aci_state.aci_pins.spi_clock_divider = SPI_CLOCK_DIV8;//SPI_CLOCK_DIV8 = 2MHz SPI speed
  193. //SPI_CLOCK_DIV16 = 1MHz SPI speed
  194.  
  195. aci_state.aci_pins.reset_pin = 4; //4 for Nordic board, UNUSED for REDBEARLAB_SHIELD_V1_1
  196. aci_state.aci_pins.active_pin = UNUSED;
  197. aci_state.aci_pins.optional_chip_sel_pin = UNUSED;
  198.  
  199. aci_state.aci_pins.interface_is_interrupt = false; //Interrupts still not available in Chipkit
  200. aci_state.aci_pins.interrupt_number = 1;
  201.  
  202. //We reset the nRF8001 here by toggling the RESET line connected to the nRF8001
  203. //If the RESET line is not available we call the ACI Radio Reset to soft reset the nRF8001
  204. //then we initialize the data structures required to setup the nRF8001
  205. //The second parameter is for turning debug printing on for the ACI Commands and Events so they be printed on the Serial
  206. lib_aci_init(&aci_state, false);
  207. Serial.println(F("Set up done"));
  208. }
  209.  
  210. void uart_over_ble_init(void)
  211. {
  212. uart_over_ble.uart_rts_local = true;
  213. }
  214.  
  215. bool uart_tx(uint8_t *buffer, uint8_t buffer_len)
  216. {
  217. bool status = false;
  218.  
  219. if (lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX) &&
  220. (aci_state.data_credit_available >= 1))
  221. {
  222. status = lib_aci_send_data(PIPE_UART_OVER_BTLE_UART_TX_TX, buffer, buffer_len);
  223. if (status)
  224. {
  225. aci_state.data_credit_available--;
  226. }
  227. }
  228.  
  229. return status;
  230. }
  231.  
  232. bool uart_process_control_point_rx(uint8_t *byte, uint8_t length)
  233. {
  234. bool status = false;
  235. aci_ll_conn_params_t *conn_params;
  236.  
  237. if (lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_CONTROL_POINT_TX) )
  238. {
  239. Serial.println(*byte, HEX);
  240. switch(*byte)
  241. {
  242. /*
  243. Queues a ACI Disconnect to the nRF8001 when this packet is received.
  244. May cause some of the UART packets being sent to be dropped
  245. */
  246. case UART_OVER_BLE_DISCONNECT:
  247. /*
  248. Parameters:
  249. None
  250. */
  251. lib_aci_disconnect(&aci_state, ACI_REASON_TERMINATE);
  252. status = true;
  253. break;
  254.  
  255.  
  256. /*
  257. Queues an ACI Change Timing to the nRF8001
  258. */
  259. case UART_OVER_BLE_LINK_TIMING_REQ:
  260. /*
  261. Parameters:
  262. Connection interval min: 2 bytes
  263. Connection interval max: 2 bytes
  264. Slave latency: 2 bytes
  265. Timeout: 2 bytes
  266. Same format as Peripheral Preferred Connection Parameters (See nRFgo studio -> nRF8001 Configuration -> GAP Settings
  267. Refer to the ACI Change Timing Request in the nRF8001 Product Specifications
  268. */
  269. conn_params = (aci_ll_conn_params_t *)(byte+1);
  270. lib_aci_change_timing( conn_params->min_conn_interval,
  271. conn_params->max_conn_interval,
  272. conn_params->slave_latency,
  273. conn_params->timeout_mult);
  274. status = true;
  275. break;
  276.  
  277. /*
  278. Clears the RTS of the UART over BLE
  279. */
  280. case UART_OVER_BLE_TRANSMIT_STOP:
  281. /*
  282. Parameters:
  283. None
  284. */
  285. uart_over_ble.uart_rts_local = false;
  286. status = true;
  287. break;
  288.  
  289.  
  290. /*
  291. Set the RTS of the UART over BLE
  292. */
  293. case UART_OVER_BLE_TRANSMIT_OK:
  294. /*
  295. Parameters:
  296. None
  297. */
  298. uart_over_ble.uart_rts_local = true;
  299. status = true;
  300. break;
  301. }
  302. }
  303.  
  304. return status;
  305. }
  306.  
  307. void aci_loop()
  308. {
  309. static bool setup_required = false;
  310.  
  311. // We enter the if statement only when there is a ACI event available to be processed
  312. if (lib_aci_event_get(&aci_state, &aci_data))
  313. {
  314. aci_evt_t * aci_evt;
  315. aci_evt = &aci_data.evt;
  316. switch(aci_evt->evt_opcode)
  317. {
  318. /**
  319. As soon as you reset the nRF8001 you will get an ACI Device Started Event
  320. */
  321. case ACI_EVT_DEVICE_STARTED:
  322. {
  323. aci_state.data_credit_total = aci_evt->params.device_started.credit_available;
  324. switch(aci_evt->params.device_started.device_mode)
  325. {
  326. case ACI_DEVICE_SETUP:
  327. /**
  328. When the device is in the setup mode
  329. */
  330. Serial.println(F("Evt Device Started: Setup"));
  331. setup_required = true;
  332. break;
  333.  
  334. case ACI_DEVICE_STANDBY:
  335. Serial.println(F("Evt Device Started: Standby"));
  336. //Looking for an iPhone by sending radio advertisements
  337. //When an iPhone connects to us we will get an ACI_EVT_CONNECTED event from the nRF8001
  338. if (aci_evt->params.device_started.hw_error)
  339. {
  340. delay(20); //Handle the HW error event correctly.
  341. }
  342. else
  343. {
  344. lib_aci_connect(0/* in seconds : 0 means forever */, 0x0050 /* advertising interval 50ms*/);
  345. Serial.println(F("Advertising started : Tap Connect on the nRF UART app"));
  346. }
  347.  
  348. break;
  349. }
  350. }
  351. break; //ACI Device Started Event
  352.  
  353. case ACI_EVT_CMD_RSP:
  354. //If an ACI command response event comes with an error -> stop
  355. if (ACI_STATUS_SUCCESS != aci_evt->params.cmd_rsp.cmd_status)
  356. {
  357. //ACI ReadDynamicData and ACI WriteDynamicData will have status codes of
  358. //TRANSACTION_CONTINUE and TRANSACTION_COMPLETE
  359. //all other ACI commands will have status code of ACI_STATUS_SCUCCESS for a successful command
  360. Serial.print(F("ACI Command "));
  361. Serial.println(aci_evt->params.cmd_rsp.cmd_opcode, HEX);
  362. Serial.print(F("Evt Cmd respone: Status "));
  363. Serial.println(aci_evt->params.cmd_rsp.cmd_status, HEX);
  364. }
  365. if (ACI_CMD_GET_DEVICE_VERSION == aci_evt->params.cmd_rsp.cmd_opcode)
  366. {
  367. //Store the version and configuration information of the nRF8001 in the Hardware Revision String Characteristic
  368. lib_aci_set_local_data(&aci_state, PIPE_DEVICE_INFORMATION_HARDWARE_REVISION_STRING_SET,
  369. (uint8_t *)&(aci_evt->params.cmd_rsp.params.get_device_version), sizeof(aci_evt_cmd_rsp_params_get_device_version_t));
  370. }
  371. break;
  372.  
  373. case ACI_EVT_CONNECTED:
  374. Serial.println(F("Evt Connected"));
  375. uart_over_ble_init();
  376. timing_change_done = false;
  377. aci_state.data_credit_available = aci_state.data_credit_total;
  378.  
  379. /*
  380. Get the device version of the nRF8001 and store it in the Hardware Revision String
  381. */
  382. lib_aci_device_version();
  383. break;
  384.  
  385. case ACI_EVT_PIPE_STATUS:
  386. Serial.println(F("Evt Pipe Status"));
  387. if (lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX) && (false == timing_change_done))
  388. {
  389. lib_aci_change_timing_GAP_PPCP(); // change the timing on the link as specified in the nRFgo studio -> nRF8001 conf. -> GAP.
  390. // Used to increase or decrease bandwidth
  391. timing_change_done = true;
  392.  
  393. char hello[]="Hello World, works";
  394. uart_tx((uint8_t *)&hello[0], strlen(hello));
  395. Serial.print(F("Sending :"));
  396. Serial.println(hello);
  397. }
  398. break;
  399.  
  400. case ACI_EVT_TIMING:
  401. Serial.println(F("Evt link connection interval changed"));
  402. lib_aci_set_local_data(&aci_state,
  403. PIPE_UART_OVER_BTLE_UART_LINK_TIMING_CURRENT_SET,
  404. (uint8_t *)&(aci_evt->params.timing.conn_rf_interval), /* Byte aligned */
  405. PIPE_UART_OVER_BTLE_UART_LINK_TIMING_CURRENT_SET_MAX_SIZE);
  406. break;
  407.  
  408. case ACI_EVT_DISCONNECTED:
  409. Serial.println(F("Evt Disconnected/Advertising timed out"));
  410. lib_aci_connect(0/* in seconds : 0 means forever */, 0x0050 /* advertising interval 50ms*/);
  411. Serial.println(F("Advertising started. Tap Connect on the nRF UART app"));
  412. break;
  413.  
  414. case ACI_EVT_DATA_RECEIVED:
  415. Serial.print(F("Pipe Number: "));
  416. Serial.println(aci_evt->params.data_received.rx_data.pipe_number, DEC);
  417.  
  418. if (PIPE_UART_OVER_BTLE_UART_RX_RX == aci_evt->params.data_received.rx_data.pipe_number)
  419. {
  420.  
  421. Serial.print(F(" Data(Hex) : "));
  422. for(int i=0; i<aci_evt->len - 2; i++)
  423. {
  424. Serial.print((char)aci_evt->params.data_received.rx_data.aci_data[i]);
  425. uart_buffer[i] = aci_evt->params.data_received.rx_data.aci_data[i];
  426. Serial.print(F(" "));
  427. }
  428. uart_buffer_len = aci_evt->len - 2;
  429. Serial.println(F(""));
  430. if (lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX))
  431. {
  432. /*Do this to test the loopback otherwise comment it out*/
  433. /*
  434. if (!uart_tx(&uart_buffer[0], aci_evt->len - 2))
  435. {
  436. Serial.println(F("UART loopback failed"));
  437. }
  438. else
  439. {
  440. Serial.println(F("UART loopback OK"));
  441. }
  442. */
  443. }
  444. }
  445. if (PIPE_UART_OVER_BTLE_UART_CONTROL_POINT_RX == aci_evt->params.data_received.rx_data.pipe_number)
  446. {
  447. uart_process_control_point_rx(&aci_evt->params.data_received.rx_data.aci_data[0], aci_evt->len - 2); //Subtract for Opcode and Pipe number
  448. }
  449. break;
  450.  
  451. case ACI_EVT_DATA_CREDIT:
  452. aci_state.data_credit_available = aci_state.data_credit_available + aci_evt->params.data_credit.credit;
  453. break;
  454.  
  455. case ACI_EVT_PIPE_ERROR:
  456. //See the appendix in the nRF8001 Product Specication for details on the error codes
  457. Serial.print(F("ACI Evt Pipe Error: Pipe #:"));
  458. Serial.print(aci_evt->params.pipe_error.pipe_number, DEC);
  459. Serial.print(F(" Pipe Error Code: 0x"));
  460. Serial.println(aci_evt->params.pipe_error.error_code, HEX);
  461.  
  462. //Increment the credit available as the data packet was not sent.
  463. //The pipe error also represents the Attribute protocol Error Response sent from the peer and that should not be counted
  464. //for the credit.
  465. if (ACI_STATUS_ERROR_PEER_ATT_ERROR != aci_evt->params.pipe_error.error_code)
  466. {
  467. aci_state.data_credit_available++;
  468. }
  469. break;
  470.  
  471. case ACI_EVT_HW_ERROR:
  472. Serial.print(F("HW error: "));
  473. Serial.println(aci_evt->params.hw_error.line_num, DEC);
  474.  
  475. for(uint8_t counter = 0; counter <= (aci_evt->len - 3); counter++)
  476. {
  477. Serial.write(aci_evt->params.hw_error.file_name[counter]); //uint8_t file_name[20];
  478. }
  479. Serial.println();
  480. lib_aci_connect(0/* in seconds, 0 means forever */, 0x0050 /* advertising interval 50ms*/);
  481. Serial.println(F("Advertising started. Tap Connect on the nRF UART app"));
  482. break;
  483.  
  484. }
  485. }
  486. else
  487. {
  488. //Serial.println(F("No ACI Events available"));
  489. // No event in the ACI Event queue and if there is no event in the ACI command queue the arduino can go to sleep
  490. // Arduino can go to sleep now
  491. // Wakeup from sleep from the RDYN line
  492. }
  493.  
  494. /* setup_required is set to true when the device starts up and enters setup mode.
  495. * It indicates that do_aci_setup() should be called. The flag should be cleared if
  496. * do_aci_setup() returns ACI_STATUS_TRANSACTION_COMPLETE.
  497. */
  498. if(setup_required)
  499. {
  500. if (SETUP_SUCCESS == do_aci_setup(&aci_state))
  501. {
  502. setup_required = false;
  503. }
  504. }
  505. }
  506.  
  507. bool stringComplete = false; // whether the string is complete
  508. uint8_t stringIndex = 0; //Initialize the index to store incoming chars
  509.  
  510. void loop() {
  511.  
  512. //Process any ACI commands or events
  513. aci_loop();
  514.  
  515. // print the string when a newline arrives:
  516. if (stringComplete)
  517. {
  518. Serial.print(F("Sending: "));
  519. Serial.println((char *)&uart_buffer[0]);
  520.  
  521. uart_buffer_len = stringIndex + 1;
  522.  
  523. if (!lib_aci_send_data(PIPE_UART_OVER_BTLE_UART_TX_TX, uart_buffer, uart_buffer_len))
  524. {
  525. Serial.println(F("Serial input dropped"));
  526. }
  527.  
  528. // clear the uart_buffer:
  529. for (stringIndex = 0; stringIndex < 20; stringIndex++)
  530. {
  531. uart_buffer[stringIndex] = ' ';
  532. }
  533.  
  534. // reset the flag and the index in order to receive more data
  535. stringIndex = 0;
  536. stringComplete = false;
  537. }
  538. //For ChipKit you have to call the function that reads from Serial
  539. #if defined (__PIC32MX__)
  540. if (Serial.available())
  541. {
  542. serialEvent();
  543. }
  544. #endif
  545. }
  546.  
  547. /*
  548. COMMENT ONLY FOR ARDUINO
  549. SerialEvent occurs whenever a new data comes in the
  550. hardware serial RX. This routine is run between each
  551. time loop() runs, so using delay inside loop can delay
  552. response. Multiple bytes of data may be available.
  553. Serial Event is NOT compatible with Leonardo, Micro, Esplora
  554. */
  555. void serialEvent() {
  556.  
  557. while(Serial.available() > 0){
  558. // get the new byte:
  559. dummychar = (uint8_t)Serial.read();
  560. if(!stringComplete)
  561. {
  562. if (dummychar == '\n')
  563. {
  564. // if the incoming character is a newline, set a flag
  565. // so the main loop can do something about it
  566. stringIndex--;
  567. stringComplete = true;
  568. }
  569. else
  570. {
  571. if(stringIndex > 19)
  572. {
  573. Serial.println("Serial input truncated");
  574. stringIndex--;
  575. stringComplete = true;
  576. }
  577. else
  578. {
  579. // add it to the uart_buffer
  580. uart_buffer[stringIndex] = dummychar;
  581. stringIndex++;
  582. }
  583. }
  584. }
  585. }
  586. }
  587.  
  588. /*Arduino: 1.0.6 (Mac OS X), Board: "Arduino Duemilanove w/ ATmega328"
  589. /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard -I/Applications/Arduino.app/Contents/Resources/Java/libraries/SPI -I/Users/c474774ck/Documents/Arduino/libraries/BLE -I/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/ble_A_Hello_World_Program.cpp -o /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/ble_A_Hello_World_Program.cpp.o
  590. ble_A_Hello_World_Program.ino: In function 'void aci_loop()':
  591. ble_A_Hello_World_Program.ino:324: warning: enumeration value 'ACI_DEVICE_INVALID' not handled in switch
  592. ble_A_Hello_World_Program.ino:324: warning: enumeration value 'ACI_DEVICE_TEST' not handled in switch
  593. ble_A_Hello_World_Program.ino:324: warning: enumeration value 'ACI_DEVICE_SLEEP' not handled in switch
  594. ble_A_Hello_World_Program.ino:316: warning: enumeration value 'ACI_EVT_INVALID' not handled in switch
  595. ble_A_Hello_World_Program.ino:316: warning: enumeration value 'ACI_EVT_ECHO' not handled in switch
  596. ble_A_Hello_World_Program.ino:316: warning: enumeration value 'ACI_EVT_BOND_STATUS' not handled in switch
  597. ble_A_Hello_World_Program.ino:316: warning: enumeration value 'ACI_EVT_DATA_ACK' not handled in switch
  598. ble_A_Hello_World_Program.ino:316: warning: enumeration value 'ACI_EVT_DISPLAY_PASSKEY' not handled in switch
  599. ble_A_Hello_World_Program.ino:316: warning: enumeration value 'ACI_EVT_KEY_REQUEST' not handled in switch
  600. Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/SPI/SPI.cpp.o
  601. Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/BLE/aci_queue.cpp.o
  602. Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/BLE/aci_setup.cpp.o
  603. Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/BLE/acilib.cpp.o
  604. Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/BLE/hal_aci_tl.cpp.o
  605. Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/BLE/lib_aci.cpp.o
  606. Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/avr_nrf_ancs_library-master/ancs_data_source.cpp.o
  607. Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/avr_nrf_ancs_library-master/ancs_notification.cpp.o
  608. Using previously compiled: /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/avr_nrf_ancs_library-master/ancs_notification_list.cpp.o
  609. /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard -I/Applications/Arduino.app/Contents/Resources/Java/libraries/SPI -I/Users/c474774ck/Documents/Arduino/libraries/BLE -I/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master -I/Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/utility /Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/ancs_notification_source.cpp -o /var/folders/2q/1r2mfjl14cxd7_76x8q169rr0000gn/T/build5835877660848783245.tmp/avr_nrf_ancs_library-master/ancs_notification_source.cpp.o
  610. In file included from /Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/ancs_notification_source.cpp:3:
  611. /Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:265: error: 'uint16_t' does not name a type
  612. /Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:269: error: 'uint16_t' does not name a type
  613. /Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:273: error: 'uint16_t' does not name a type
  614. /Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:275: error: 'uint16_t' does not name a type
  615. /Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:342: error: 'uint8_t' does not name a type
  616. /Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:343: error: 'uint8_t' does not name a type
  617. /Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:346: error: size of array 'aci_tx_data_t_assert_size_t' is negative
  618. /Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:354: error: 'uint8_t' does not name a type
  619. /Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:355: error: 'uint8_t' does not name a type
  620. /Users/c474774ck/Documents/Arduino/libraries/BLE/aci.h:358: error: size of array 'aci_rx_data_t_assert_size_t' is negative
  621. /Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/ancs_notification_source.cpp: In function 'bool ancs_send_buffered_command()':
  622. /Users/c474774ck/Documents/Arduino/libraries/avr_nrf_ancs_library-master/ancs_notification_source.cpp:43: error: 'lib_aci_send_data' was not declared in this scope*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement