spp_server.c (b56e8b561bce450f5cd8828749be22a67c2bd9ec) | spp_server.c (5c51cbf6cdcfb0e60ae824cf096ff284e6909e75) |
---|---|
1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 104 unchanged lines hidden (view full) --- 113 114 // 0x0009 "Bluetooth Profile Descriptor List" 115 de_add_number(service, DE_UINT, DE_SIZE_16, BLUETOOTH_ATTRIBUTE_BLUETOOTH_PROFILE_DESCRIPTOR_LIST); 116 attribute = de_push_sequence(service); 117 { 118 uint8_t *sppProfile = de_push_sequence(attribute); 119 { 120 de_add_number(sppProfile, DE_UUID, DE_SIZE_16, BLUETOOTH_SERVICE_CLASS_SERIAL_PORT); | 1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 104 unchanged lines hidden (view full) --- 113 114 // 0x0009 "Bluetooth Profile Descriptor List" 115 de_add_number(service, DE_UINT, DE_SIZE_16, BLUETOOTH_ATTRIBUTE_BLUETOOTH_PROFILE_DESCRIPTOR_LIST); 116 attribute = de_push_sequence(service); 117 { 118 uint8_t *sppProfile = de_push_sequence(attribute); 119 { 120 de_add_number(sppProfile, DE_UUID, DE_SIZE_16, BLUETOOTH_SERVICE_CLASS_SERIAL_PORT); |
121 de_add_number(sppProfile, DE_UINT, DE_SIZE_16, BLUETOOTH_SERVICE_CLASS_LAN_ACCESS_USING_PPP); | 121 de_add_number(sppProfile, DE_UINT, DE_SIZE_16, 0x0102); |
122 } 123 de_pop_sequence(attribute, sppProfile); 124 } 125 de_pop_sequence(service, attribute); 126 127 // 0x0100 "ServiceName" 128 de_add_number(service, DE_UINT, DE_SIZE_16, 0x0100); 129 de_add_data(service, DE_STRING, (uint16_t) strlen(name), (uint8_t *) name); 130} 131 132void spp_create_sdp_record(uint8_t *service, uint32_t service_record_handle, int rfcomm_channel, const char *name){ 133 spp_create_sdp_record_internal(service, service_record_handle, NULL, rfcomm_channel, name); 134} 135 136void spp_create_custom_sdp_record(uint8_t *service, uint32_t service_record_handle, const uint8_t * service_uuid128, int rfcomm_channel, const char *name){ 137 spp_create_sdp_record_internal(service, service_record_handle, service_uuid128, rfcomm_channel, name); 138} | 122 } 123 de_pop_sequence(attribute, sppProfile); 124 } 125 de_pop_sequence(service, attribute); 126 127 // 0x0100 "ServiceName" 128 de_add_number(service, DE_UINT, DE_SIZE_16, 0x0100); 129 de_add_data(service, DE_STRING, (uint16_t) strlen(name), (uint8_t *) name); 130} 131 132void spp_create_sdp_record(uint8_t *service, uint32_t service_record_handle, int rfcomm_channel, const char *name){ 133 spp_create_sdp_record_internal(service, service_record_handle, NULL, rfcomm_channel, name); 134} 135 136void spp_create_custom_sdp_record(uint8_t *service, uint32_t service_record_handle, const uint8_t * service_uuid128, int rfcomm_channel, const char *name){ 137 spp_create_sdp_record_internal(service, service_record_handle, service_uuid128, rfcomm_channel, name); 138} |