mock.c (a874746709fd7a8c0715bc158b817e9b8a601294) mock.c (5611a760af48d1ce1beea59c7908be73bd2393f1)
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

--- 194 unchanged lines hidden (view full) ---

203
204void sdp_query_rfcomm_register_callback(void(*sdp_app_callback)(uint8_t packet_type, uint8_t *packet, uint16_t size, void * context), void * context){
205 registered_sdp_app_callback = sdp_app_callback;
206 registered_sdp_app_context = context;
207}
208
209static void sdp_query_complete_response(uint8_t status){
210 uint8_t event[3];
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

--- 194 unchanged lines hidden (view full) ---

203
204void sdp_query_rfcomm_register_callback(void(*sdp_app_callback)(uint8_t packet_type, uint8_t *packet, uint16_t size, void * context), void * context){
205 registered_sdp_app_callback = sdp_app_callback;
206 registered_sdp_app_context = context;
207}
208
209static void sdp_query_complete_response(uint8_t status){
210 uint8_t event[3];
211 event[0] = SDP_QUERY_COMPLETE;
211 event[0] = SDP_EVENT_QUERY_COMPLETE;
212 event[1] = 1;
213 event[2] = status;
214 (*registered_sdp_app_callback)(HCI_EVENT_PACKET, event, sizeof(event), registered_sdp_app_context);
215}
216
217static void sdp_query_rfcomm_service_response(uint8_t status){
218 int sdp_service_name_len = strlen(sdp_rfcomm_service_name);
219 uint8_t event[3+SDP_SERVICE_NAME_LEN+1];
212 event[1] = 1;
213 event[2] = status;
214 (*registered_sdp_app_callback)(HCI_EVENT_PACKET, event, sizeof(event), registered_sdp_app_context);
215}
216
217static void sdp_query_rfcomm_service_response(uint8_t status){
218 int sdp_service_name_len = strlen(sdp_rfcomm_service_name);
219 uint8_t event[3+SDP_SERVICE_NAME_LEN+1];
220 event[0] = SDP_QUERY_RFCOMM_SERVICE;
220 event[0] = SDP_EVENT_QUERY_RFCOMM_SERVICE;
221 event[1] = sdp_service_name_len + 1;
222 event[2] = sdp_rfcomm_channel_nr;
223 memcpy(&event[3], sdp_rfcomm_service_name, sdp_service_name_len);
224 event[3+sdp_service_name_len] = 0;
225 (*registered_sdp_app_callback)(HCI_EVENT_PACKET, event, sizeof(event), registered_sdp_app_context);
226}
227
228void sdp_query_rfcomm_channel_and_name_for_uuid(bd_addr_t remote, uint16_t uuid){

--- 136 unchanged lines hidden ---
221 event[1] = sdp_service_name_len + 1;
222 event[2] = sdp_rfcomm_channel_nr;
223 memcpy(&event[3], sdp_rfcomm_service_name, sdp_service_name_len);
224 event[3+sdp_service_name_len] = 0;
225 (*registered_sdp_app_callback)(HCI_EVENT_PACKET, event, sizeof(event), registered_sdp_app_context);
226}
227
228void sdp_query_rfcomm_channel_and_name_for_uuid(bd_addr_t remote, uint16_t uuid){

--- 136 unchanged lines hidden ---