HW layer for the Nucleo board, it only work with old BLE_API
Dependents: Hello_BLE F446RE-BLE
Fork of X_NUCLEO_IDB0XA1 by
Diff: BlueNRGGap.cpp
- Revision:
- 46:01f97cfcc109
- Parent:
- 45:1fff7d7d5ce7
- Child:
- 52:94638d2461c1
--- a/BlueNRGGap.cpp Fri Sep 05 06:41:21 2014 +0000 +++ b/BlueNRGGap.cpp Fri Sep 05 08:42:35 2014 +0000 @@ -171,8 +171,14 @@ DEBUG("Advertising type: APPEARANCE\n\r"); const char *deviceAppearance = NULL; deviceAppearance = (const char*)loadPtr.getUnitAtIndex(index).getDataPtr(); // to be set later when startAdvertising() is called - DEBUG("input: deviceAppearance= 0x%x 0x%x..., strlen(deviceAppearance)=%d\n\r", deviceAppearance[1], deviceAppearance[0], (uint8_t)*loadPtr.getUnitAtIndex(index).getLenPtr()-1); /**< \ref Appearance */ - aci_gatt_update_char_value(g_gap_service_handle, g_appearance_char_handle, 0, 2, (tHalUint8 *)deviceAppearance); + + uint8_t Appearance[2]; + uint16_t devP = (uint16_t)*deviceAppearance; + STORE_LE_16(Appearance, (uint16_t)devP); + + DEBUG("input: deviceAppearance= 0x%x 0x%x..., strlen(deviceAppearance)=%d\n\r", Appearance[1], Appearance[0], (uint8_t)*loadPtr.getUnitAtIndex(index).getLenPtr()-1); /**< \ref Appearance */ + + aci_gatt_update_char_value(g_gap_service_handle, g_appearance_char_handle, 0, 2, (tHalUint8 *)deviceAppearance);//not using array Appearance[2] break; case GapAdvertisingData::ADVERTISING_INTERVAL: /**< Advertising Interval */ advtInterval = (uint16_t)(*loadPtr.getUnitAtIndex(index).getDataPtr());