.

Dependencies:   BLE_API TxIR mbed nRF51822

Fork of ir-puck by Nordic Pucks

Committer:
aleksanb
Date:
Wed Jul 09 14:50:18 2014 +0000
Revision:
2:b1bffa31a634
Parent:
0:c94311378ec1
Forked for PRQ reasons.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sigveseb 0:c94311378ec1 1 #include "BLEDevice.h"
sigveseb 0:c94311378ec1 2
sigveseb 0:c94311378ec1 3 uint8_t uuid_array_service[16] = {'b', 'f', 't', 'j', ' ', 'i', 'r', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '};
sigveseb 0:c94311378ec1 4 uint8_t uuid_array_header[16] = {'b', 'f', 't', 'j', ' ', 'i', 'r', ' ', 'h', 'e', 'a', 'd', 'e', 'r', ' ', ' '};
sigveseb 0:c94311378ec1 5 uint8_t uuid_array_one[16] = {'b', 'f', 't', 'j', ' ', 'i', 'r', ' ', 'o', 'n', 'e', ' ', ' ', ' ', ' ', ' '};
sigveseb 0:c94311378ec1 6 uint8_t uuid_array_zero[16] = {'b', 'f', 't', 'j', ' ', 'i', 'r', ' ', 'z', 'e', 'r', 'o', ' ', ' ', ' ', ' '};
sigveseb 0:c94311378ec1 7 uint8_t uuid_array_ptrail[16] = {'b', 'f', 't', 'j', ' ', 'i', 'r', ' ', 'p', 't', 'r', 'a', 'i', 'l', ' ', ' '};
sigveseb 0:c94311378ec1 8 uint8_t uuid_array_predata[16] = {'b', 'f', 't', 'j', ' ', 'i', 'r', ' ', 'p', 'r', 'e', 'd', 'a', 't', 'a', ' '};
sigveseb 0:c94311378ec1 9 uint8_t uuid_array_code[16] = {'b', 'f', 't', 'j', ' ', 'i', 'r', ' ', 'c', 'o', 'd', 'e', ' ', ' ', ' ', ' '};
sigveseb 0:c94311378ec1 10
sigveseb 0:c94311378ec1 11 const UUID uuid_service = UUID(uuid_array_service);
sigveseb 0:c94311378ec1 12 const UUID uuid_header = UUID(uuid_array_header);
sigveseb 0:c94311378ec1 13 const UUID uuid_one = UUID(uuid_array_one);
sigveseb 0:c94311378ec1 14 const UUID uuid_zero = UUID(uuid_array_zero);
sigveseb 0:c94311378ec1 15 const UUID uuid_ptrail = UUID(uuid_array_ptrail);
sigveseb 0:c94311378ec1 16 const UUID uuid_predata = UUID(uuid_array_predata);
sigveseb 0:c94311378ec1 17 const UUID uuid_code = UUID(uuid_array_code);
sigveseb 0:c94311378ec1 18
sigveseb 0:c94311378ec1 19 uint8_t header_data[4];
sigveseb 0:c94311378ec1 20 uint16_t header_data_length = 4;
sigveseb 0:c94311378ec1 21 uint8_t one_data[4];
sigveseb 0:c94311378ec1 22 uint16_t one_data_length = 4;
sigveseb 0:c94311378ec1 23 uint8_t zero_data[4];
sigveseb 0:c94311378ec1 24 uint16_t zero_data_length = 4;
sigveseb 0:c94311378ec1 25 uint8_t ptrail_data[2];
sigveseb 0:c94311378ec1 26 uint16_t ptrail_data_length = 2;
sigveseb 0:c94311378ec1 27 uint8_t predata_data[2];
sigveseb 0:c94311378ec1 28 uint16_t predata_data_length = 2;
sigveseb 0:c94311378ec1 29 uint8_t code_data[2];
sigveseb 0:c94311378ec1 30 uint16_t code_data_length = 2;
sigveseb 0:c94311378ec1 31
sigveseb 0:c94311378ec1 32 GattCharacteristic header = GattCharacteristic(uuid_header, header_data, sizeof(header_data), sizeof(header_data), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ);
sigveseb 0:c94311378ec1 33 GattCharacteristic one = GattCharacteristic(uuid_one, one_data, sizeof(one_data), sizeof(one_data), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ);
sigveseb 0:c94311378ec1 34 GattCharacteristic zero = GattCharacteristic(uuid_zero, zero_data, sizeof(zero_data), sizeof(zero_data), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE);
sigveseb 0:c94311378ec1 35 GattCharacteristic ptrail = GattCharacteristic(uuid_ptrail, ptrail_data, sizeof(ptrail_data), sizeof(ptrail_data), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE);
sigveseb 0:c94311378ec1 36 GattCharacteristic predata = GattCharacteristic(uuid_predata, predata_data, sizeof(predata_data), sizeof(predata_data), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE);
sigveseb 0:c94311378ec1 37 GattCharacteristic code = GattCharacteristic(uuid_code, code_data, sizeof(code_data), sizeof(code_data), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE);
sigveseb 0:c94311378ec1 38
sigveseb 0:c94311378ec1 39 GattCharacteristic *characteristics[] = {&header, &one, &zero, &ptrail, &predata, &code};
sigveseb 0:c94311378ec1 40 GattService ir_service = GattService(uuid_service, characteristics, sizeof(characteristics) / sizeof(GattCharacteristic *));