btstack/tool/conversion_to_1.0.sh
2016-02-10 17:03:30 +01:00

55 lines
4.2 KiB
Bash

-e 's/SDP_EVENT_QUERY_COMPLETE/SDP_EVENT_QUERY_COMPLETE/g'
-e 's/SDP_EVENT_QUERY_RFCOMM_SERVICE/SDP_EVENT_QUERY_RFCOMM_SERVICE/g'
-e 's/SDP_EVENT_QUERY_ATTRIBUTE_BYTE/SDP_EVENT_QUERY_ATTRIBUTE_BYTE/g'
-e 's/SDP_EVENT_QUERY_ATTRIBUTE_VALUE/SDP_EVENT_QUERY_ATTRIBUTE_VALUE/g'
-e 's/SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE/SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE/g'
-e 's/GATT_EVENT_QUERY_COMPLETE/GATT_EVENT_QUERY_COMPLETE/g'
-e 's/GATT_EVENT_SERVICE_QUERY_RESULT/GATT_EVENT_SERVICE_QUERY_RESULT/g'
-e 's/GATT_EVENT_CHARACTERISTIC_QUERY_RESULT/GATT_EVENT_CHARACTERISTIC_QUERY_RESULT/g'
-e 's/GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT/GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT/g'
-e 's/GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT/GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT/g'
-e 's/GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT/GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT/g'
-e 's/GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT/GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT/g'
-e 's/GATT_EVENT_NOTIFICATION/GATT_EVENT_NOTIFICATION/g'
-e 's/GATT_EVENT_INDICATION/GATT_EVENT_INDICATION/g'
-e 's/GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT/GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT/g'
-e 's/GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT/GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT/g'
-e 's/GATT_EVENT_MTU/GATT_EVENT_MTU/g'
-e 's/ATT_EVENT_MTU_EXCHANGE_COMPLETE/ATT_EVENT_MTU_EXCHANGE_COMPLETE/g'
-e 's/ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE/ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE/g'
-e 's/SM_EVENT_JUST_WORKS_REQUEST/SM_EVENT_JUST_WORKS_REQUEST/g'
-e 's/SM_EVENT_JUST_WORKS_CANCEL/SM_EVENT_JUST_WORKS_CANCEL/g'
-e 's/SM_EVENT_PASSKEY_DISPLAY_NUMBER/SM_EVENT_PASSKEY_DISPLAY_NUMBER/g'
-e 's/SM_EVENT_PASSKEY_DISPLAY_CANCEL/SM_EVENT_PASSKEY_DISPLAY_CANCEL/g'
-e 's/SM_EVENT_PASSKEY_INPUT_NUMBER/SM_EVENT_PASSKEY_INPUT_NUMBER/g'
-e 's/SM_EVENT_PASSKEY_INPUT_CANCEL/SM_EVENT_PASSKEY_INPUT_CANCEL/g'
-e 's/SM_EVENT_IDENTITY_RESOLVING_STARTED/SM_EVENT_IDENTITY_RESOLVING_STARTED/g'
-e 's/SM_EVENT_IDENTITY_RESOLVING_FAILED/SM_EVENT_IDENTITY_RESOLVING_FAILED/g'
-e 's/SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED/SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED/g'
-e 's/SM_EVENT_AUTHORIZATION_REQUEST/SM_EVENT_AUTHORIZATION_REQUEST/g'
-e 's/SM_EVENT_AUTHORIZATION_RESULT/SM_EVENT_AUTHORIZATION_RESULT/g'
-e 's/GAP_EVENT_SECURITY_LEVEL/GAP_EVENT_SECURITY_LEVEL/g'
-e 's/GAP_EVENT_DEDICATED_BONDING_COMPLETED/GAP_EVENT_DEDICATED_BONDING_COMPLETED/g'
-e 's/GAP_LE_EVENT_ADVERTISING_REPORT/GAP_LE_EVENT_ADVERTISING_REPORT/g'
-e 's/ANCS_EVENT_CLIENT_CONNECTED/ANCS_EVENT_CLIENT_CONNECTED/g'
-e 's/ANCS_EVENT_CLIENT_NOTIFICATION/ANCS_EVENT_CLIENT_NOTIFICATION/g'
-e 's/ANCS_EVENT_CLIENT_DISCONNECTED/ANCS_EVENT_CLIENT_DISCONNECTED/g'
--
#define READ_BT_16( buffer, pos) ( ((uint16_t) buffer[pos]) | (((uint16_t)buffer[(pos)+1]) << 8))
#define READ_BT_24( buffer, pos) ( ((uint32_t) buffer[pos]) | (((uint32_t)buffer[(pos)+1]) << 8) | (((uint32_t)buffer[(pos)+2]) << 16))
#define READ_BT_32( buffer, pos) ( ((uint32_t) buffer[pos]) | (((uint32_t)buffer[(pos)+1]) << 8) | (((uint32_t)buffer[(pos)+2]) << 16) | (((uint32_t) buffer[(pos)+3])) << 24)
#define READ_NET_16( buffer, pos) ( ((uint16_t) buffer[(pos)+1]) | (((uint16_t)buffer[ pos ]) << 8))
#define READ_NET_32( buffer, pos) ( ((uint32_t) buffer[(pos)+3]) | (((uint32_t)buffer[(pos)+2]) << 8) | (((uint32_t)buffer[(pos)+1]) << 16) | (((uint32_t) buffer[pos])) << 24)
#define READ_L2CAP_LENGTH(buffer) ( READ_BT_16(buffer, 4))
#define READ_L2CAP_CHANNEL_ID(buffer) ( READ_BT_16(buffer, 6))
void bt_store_16(uint8_t *buffer, uint16_t pos, uint16_t value);
void bt_store_32(uint8_t *buffer, uint16_t pos, uint32_t value);
void net_store_16(uint8_t *buffer, uint16_t pos, uint16_t value);
void net_store_32(uint8_t *buffer, uint16_t pos, uint32_t value);
find . -type f -print0 | xargs -0 sed -i -e 's/READ_BT_16/little_endian_read_16/g' -e 's/READ_BT_24/little_endian_read_24/g' -e 's/READ_BT_32/little_endian_read_32/g' -e 's/READ_NET_16/big_endian_read_16/g' -e 's/READ_NET_32/big_endian_read_32/g' -e 's/bt_store_16/little_endian_store_16/g' -e 's/bt_store_32/little_endian_store_32/g' -e 's/net_store_16/big_endian_store_16/g' -e 's/net_store_32/big_endian_store_32/g'