hfp_hf.c (5f5a28727da165605a5e9acaada3fc6548d9d682) hfp_hf.c (f127324f1a217974589d2f1aac4017129c807438)
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

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

234}
235
236static void hfp_emit_network_operator_event(const hfp_connection_t * hfp_connection){
237 if (hfp_hf_callback == NULL) return;
238 uint16_t operator_len = btstack_min(strlen(hfp_connection->network_operator.name), HFP_MAX_NETWORK_OPERATOR_NAME_SIZE-1);
239 uint8_t event[7+HFP_MAX_NETWORK_OPERATOR_NAME_SIZE];
240 event[0] = HCI_EVENT_HFP_META;
241 event[1] = sizeof(event) - 2;
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

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

234}
235
236static void hfp_emit_network_operator_event(const hfp_connection_t * hfp_connection){
237 if (hfp_hf_callback == NULL) return;
238 uint16_t operator_len = btstack_min(strlen(hfp_connection->network_operator.name), HFP_MAX_NETWORK_OPERATOR_NAME_SIZE-1);
239 uint8_t event[7+HFP_MAX_NETWORK_OPERATOR_NAME_SIZE];
240 event[0] = HCI_EVENT_HFP_META;
241 event[1] = sizeof(event) - 2;
242 event[2] = 6 + operator_len;
242 event[2] = HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED;
243 little_endian_store_16(event, 3, hfp_connection->acl_handle);
244 event[5] = hfp_connection->network_operator.mode;
245 event[6] = hfp_connection->network_operator.format;
246 memcpy(&event[7], hfp_connection->network_operator.name, operator_len);
247 event[7+operator_len] = 0;
248 (*hfp_hf_callback)(HCI_EVENT_PACKET, 0, event, 8 + operator_len);
249}
250

--- 1965 unchanged lines hidden ---
243 little_endian_store_16(event, 3, hfp_connection->acl_handle);
244 event[5] = hfp_connection->network_operator.mode;
245 event[6] = hfp_connection->network_operator.format;
246 memcpy(&event[7], hfp_connection->network_operator.name, operator_len);
247 event[7+operator_len] = 0;
248 (*hfp_hf_callback)(HCI_EVENT_PACKET, 0, event, 8 + operator_len);
249}
250

--- 1965 unchanged lines hidden ---