summaryrefslogtreecommitdiff
path: root/tests/unittest/mock/bluetooth-mock.c
blob: 546d0506df246b6e1b54a6cd0365138d7118cc1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>

#include <system_info.h>
#include <glib.h>
#include <gio/gio.h>

#include <bluetooth-api.h>
#include <bluetooth-media-control.h>
#include <bluetooth-audio-api.h>
#include <bluetooth-telephony-api.h>
#include <bluetooth-ipsp-api.h>
#include <bluetooth-gatt-server-api.h>
#include <bluetooth-gatt-client-api.h>
#include <bluetooth-hid-api.h>
#include <bluetooth-mesh-api.h>

#ifndef API
#define API __attribute__ ((visibility("default")))
#endif

static const char g_remote_addr[BLUETOOTH_ADDRESS_LENGTH] = {0x00, 0x02, 0x33, 0xA9, 0xE7, 0xF6};
static const char g_uuid1[BLUETOOTH_UUID_STRING_MAX] = "00001105-0000-1000-8000-00805F9B34FB";
static const char g_uuid2[BLUETOOTH_UUID_STRING_MAX] = "0000110A-0000-1000-8000-00805F9B34FB";
static bluetooth_device_info_t g_device_info;
static bluetooth_le_device_info_t g_le_device_info;
static int g_adv_handle;
static guint g_adv_ind_data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX] = {0x01, 0x02, 0x03};
static guint g_scan_resp_data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX] = {0x04, 0x05, 0x06};

static bluetooth_cb_func_ptr adapter_event_cb;
static bluetooth_cb_func_ptr le_adapter_event_cb;
static mesh_cb_func_ptr bt_mesh_event_proxy_cb;

static gboolean __adapter_event_cb(gpointer user_data)
{
	bluetooth_event_param_t *bt_event = user_data;
	adapter_event_cb(bt_event->event, bt_event, NULL);
	g_free(bt_event);
	return FALSE;
}

static gboolean __adapter_le_event_cb(gpointer user_data)
{
	bluetooth_event_param_t *bt_event = user_data;
	le_adapter_event_cb(bt_event->event, bt_event, NULL);
	g_free(bt_event);
	return FALSE;
}

static gboolean __mesh_event_cb(gpointer user_data)
{
	mesh_event_param_t *bt_event = (mesh_event_param_t *)user_data;

	bt_mesh_event_proxy_cb(bt_event->event, bt_event, NULL);
	g_free(bt_event->param_data);
	g_free(bt_event);
	return FALSE;
}

API int system_info_get_platform_bool(const char *key, bool *value)
{
	*value = true;
	return SYSTEM_INFO_ERROR_NONE;
}

API int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
{
	adapter_event_cb = callback_ptr;

	/* Initialize device info */
	memcpy(g_device_info.device_address.addr, g_remote_addr, BLUETOOTH_ADDRESS_LENGTH);
	strncpy(g_device_info.device_name.name, "Tizen", BLUETOOTH_DEVICE_NAME_LENGTH_MAX);
	g_device_info.device_class.major_class = BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE;
	g_device_info.device_class.minor_class = BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION;
	g_device_info.device_class.service_class = BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER;
	g_device_info.paired = TRUE;
	g_device_info.connected = FALSE;
	g_device_info.service_index = 2;
	strncpy(g_device_info.uuids[0], g_uuid1, BLUETOOTH_UUID_STRING_MAX);
	strncpy(g_device_info.uuids[1], g_uuid2, BLUETOOTH_UUID_STRING_MAX);

	/* Initialize le device info */
	memcpy(g_le_device_info.device_address.addr, g_remote_addr, BLUETOOTH_ADDRESS_LENGTH);
	g_le_device_info.addr_type = BLUETOOTH_BDADDR_LE_PUBLIC;
	g_le_device_info.rssi = -70;
	g_le_device_info.adv_ind_data.data_len = 3;
	memcpy(g_le_device_info.adv_ind_data.data.data, g_adv_ind_data, BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX);
	g_le_device_info.scan_resp_data.data_len = 3;
	memcpy(g_le_device_info.scan_resp_data.data.data, g_scan_resp_data, BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX);

	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_unregister_callback(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
{
	le_adapter_event_cb = callback_ptr;
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_le_unregister_callback(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_check_adapter(void)
{
	return BLUETOOTH_ADAPTER_ENABLED;
}

API int bluetooth_check_adapter_le(void)
{
	return BLUETOOTH_ADAPTER_ENABLED;
}

API int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
{
	memcpy(local_address->addr, g_remote_addr, BLUETOOTH_ADDRESS_LENGTH);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_get_local_name(bluetooth_device_name_t *local_name)
{
	memset(local_name->name, 0x00, sizeof(local_name->name));
	strncpy(local_name->name, "Tizen", sizeof(local_name->name));
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
{
	bluetooth_event_param_t *bt_event = NULL;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_LOCAL_NAME_CHANGED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = (void *)local_name;

	g_timeout_add(500, __adapter_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_start_le_discovery(void)
{
	bluetooth_event_param_t *bt_event = NULL;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = &g_le_device_info;

	g_timeout_add(500, __adapter_le_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_start_discovery(unsigned short max_response,
		unsigned short discovery_duration,
		unsigned int classOfDeviceMask)
{
	bluetooth_event_param_t *bt_event = NULL;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = &g_device_info;

	g_timeout_add(500, __adapter_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
{
	*discoverable_mode_ptr = BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE;
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
{
	*used = TRUE;
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
{
	char buf[] = {0x01, 0x02, 0x03, 0x04};
	memset(local_oob_data, 0x00, sizeof(bt_oob_data_t));

	memcpy(local_oob_data->hash, buf, sizeof(BLUETOOTH_OOB_DATA_LENGTH));
	local_oob_data->hash_len = sizeof(buf);
	memcpy(local_oob_data->randomizer, buf, sizeof(BLUETOOTH_OOB_DATA_LENGTH));
	local_oob_data->randomizer_len = sizeof(buf);

	memcpy(local_oob_data->hash256, buf, sizeof(BLUETOOTH_OOB_DATA_LENGTH));
	local_oob_data->hash256_len = sizeof(buf);
	memcpy(local_oob_data->randomizer256, buf, sizeof(BLUETOOTH_OOB_DATA_LENGTH));
	local_oob_data->randomizer256_len = sizeof(buf);

	memcpy(local_oob_data->eir, buf, sizeof(BLUETOOTH_OOB_DATA_LENGTH));
	local_oob_data->eir_len = sizeof(buf);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params)
{
	g_adv_handle = handle;
	bluetooth_event_param_t *bt_event = NULL;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_ADVERTISING_STARTED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = (void *)&g_adv_handle;

	g_timeout_add(500, __adapter_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_set_advertising(int handle, gboolean enable)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_is_advertising(gboolean *is_advertising)
{
	*is_advertising = TRUE;
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_stop_le_discovery(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
{
	*is_supported = TRUE;
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
{
	*is_supported = TRUE;
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_av_connect(bluetooth_device_address_t *remote_address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_av_disconnect(bluetooth_device_address_t *remote_address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_audio_deinit(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hf_deinit(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_telephony_deinit(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_media_player_change_property(
		media_player_property_type type,
		unsigned int value)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_media_player_change_track(
		media_metadata_attributes_t *metadata)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_audio_init(bt_audio_func_ptr cb, void *user_data)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hf_init(bt_hf_func_ptr cb, void *user_data)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_telephony_init(bt_telephony_func_ptr cb, void  *user_data)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
{
	bluetooth_event_param_t *bt_event = NULL;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_BONDING_FINISHED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = &g_device_info;

	g_timeout_add(500, __adapter_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_cancel_bonding(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
{
	bluetooth_event_param_t *bt_event = NULL;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = (void *)&g_remote_addr;

	g_timeout_add(500, __adapter_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
{
//	g_ptr_array_add(*dev_list, &g_device_info);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
		const char *alias)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
		gboolean authorized)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
		bluetooth_service_type_t type, gboolean *is_connected)
{
	*is_connected = TRUE;
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
		const bluetooth_le_connection_mode_t mode)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_is_discovering(void)
{
	return TRUE;
}

API int bluetooth_cancel_discovery(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
		gboolean auto_connect, int client_id)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
		int client_id)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_server_update_characteristic(int instance_id,
		const bluetooth_gatt_server_update_value_t *value)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_client_get_characteristics_property(
		const char *address,
		bt_gatt_handle_property_t *service_handle,
		bt_gatt_handle_property_t *char_handle,
		bt_gatt_char_property_t *char_property)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_client_get_char_descriptor_property(
		const char *address,
		bt_gatt_handle_property_t *service_handle,
		bt_gatt_handle_property_t *char_handle,
		bt_gatt_handle_property_t *descriptor_handle,
		bt_gatt_char_descriptor_property_t *desc_prop)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_client_set_service_change_watcher(
		const bluetooth_device_address_t *address, gboolean enable)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_set_service_change_watcher(
		const bluetooth_device_address_t *address, gboolean enable)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_client_deinit(int client_id)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_server_init(int *instance_id, gatt_server_cb_func_ptr callback_ptr,
		void *user_data)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_server_add_service(const char *svc_uuid, int type, int numhandles,
		int instance_id, int *service_handle)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_server_add_new_characteristic(const char *char_uuid,
		const bluetooth_gatt_server_attribute_params_t *param,
		int *char_handle)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_server_add_descriptor(const char *desc_uuid, bt_gatt_permission_t permissions,
		int service_handle, int instance_id, int *descriptor_handle)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_register_application(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_unregister_application(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_server_start_service(int service_handle, int instance_id)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_server_send_response(const bluetooth_gatt_server_response_params_t *param,
		const bluetooth_gatt_att_data_t *value)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_ipsp_init(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_ipsp_deinit(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_ipsp_connect(const ipsp_device_address_t *device_address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_ipsp_disconnect(const ipsp_device_address_t *device_address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
		unsigned int *mtu)
{
	*mtu = 512;
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_gatt_client_init(
		int *client_id,
		const bluetooth_device_address_t *address,
		gatt_client_cb_func_ptr callback_ptr)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hdp_disconnect(unsigned int channel_id,
		const bluetooth_device_address_t *device_address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hdp_connect(const char *app_handle,
		bt_hdp_qos_type_t channel_type,
		const bluetooth_device_address_t *device_address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hdp_activate(unsigned short data_type,
		bt_hdp_role_type_t role,
		bt_hdp_qos_type_t channel_type,
		char **app_handle)
{
	*app_handle = g_strdup("1234");
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hdp_deactivate(const char *app_handle)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hdp_send_data(unsigned int channel_id,
		const char *buffer,
		unsigned int size)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_init(hid_cb_func_ptr callback_ptr, void *user_data)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_deinit(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_connect(hid_device_address_t *device_address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_disconnect(hid_device_address_t *device_address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_device_init(hid_cb_func_ptr callback_ptr, void *user_data)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_device_deinit(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_device_activate(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_device_deactivate(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_device_connect(const char *remote_addr)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_device_disconnect(const char *remote_addr)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_device_send_mouse_event(const char *remote_addr,
		hid_send_mouse_event_t send_event)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_device_send_key_event(const char *remote_addr,
		hid_send_key_event_t send_event)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_hid_device_reply_to_report(const char *remote_addr,
		bt_hid_header_type_t htype,
		bt_hid_param_type_t ptype,
		const char *data,
		unsigned int data_len)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_opc_init(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_opc_deinit(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
		char **file_name_array)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_opc_cancel_push(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_pbap_init(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_pbap_deinit(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_pbap_connect(const bluetooth_device_address_t *address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
		bt_pbap_folder_t *folder)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
		bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
		bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
		bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
		bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_search_service(const bluetooth_device_address_t *device_address)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_rfcomm_create_socket(const char *uuid)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_rfcomm_remove_socket(int id)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_rfcomm_listen_and_accept(int id, int max_pending_connection)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_l2cap_le_listen(int id, int max_pending_connection)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_l2cap_le_listen_and_accept(int id, int max_pending_connection)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_rfcomm_connect(
		const bluetooth_device_address_t *remote_bt_address,
		const char *remote_uuid)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_rfcomm_disconnect(int socket_fd)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_rfcomm_write(int fd, const char *buf, int length)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_obex_server_init_without_agent(const char *dst_path)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_obex_server_deinit(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_obex_server_set_destination_path(const char *dst_path)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_obex_server_cancel_transfer(int transfer_id)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_obex_server_deinit_without_agent(void)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_init(mesh_cb_func_ptr callback_ptr, void *user_data)
{
	bt_mesh_event_proxy_cb = callback_ptr;

	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_create(const char *net_name, bluetooth_mesh_node_t *node,
		uint16_t total_models, bluetooth_mesh_model_t **models,
		bluetooth_mesh_network_t *network)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_load(const char *token,
			bluetooth_mesh_network_t *network)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_set_name(bluetooth_mesh_network_t *network)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_add_netkey(bluetooth_mesh_network_t *network,
			uint16_t *netkey_idx)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_get_all_netkey(bluetooth_mesh_network_t *network,
		GPtrArray **netkeys)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_update_netkey(bluetooth_mesh_network_t *network,
		uint16_t netkey_idx)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_delete_netkey(bluetooth_mesh_network_t *network,
		uint16_t netkey_idx)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_add_appkey(bluetooth_mesh_network_t *network,
		uint16_t netkey_index, uint16_t *appkey_index)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_netkey_get_all_appkey(bluetooth_mesh_network_t *network,
		uint16_t netkey_idx, GPtrArray **appkeys)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_update_appkey(bluetooth_mesh_network_t *network,
		uint16_t netkey_index, uint16_t appkey_index)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_delete_appkey(bluetooth_mesh_network_t *network,
		uint16_t netkey_index, uint16_t appkey_index)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_get_all_nodes(bluetooth_mesh_network_t *network,
		GPtrArray **nodes)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_create_group(bluetooth_mesh_network_t *network,
	bool is_virtual, uint16_t grp_addr, bluetooth_mesh_network_group_info_t *info)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_get_all_groups(bluetooth_mesh_network_t *network,
	GPtrArray **groups)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_scan(bluetooth_mesh_network_t *network,
		bluetooth_mesh_scan_param_t *scan_param)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_scan_result_t *scan_result = NULL;

	scan_result = g_malloc0(sizeof(bluetooth_mesh_scan_result_t));
	scan_result->rssi = 45;
	memcpy(scan_result->dev_uuid, g_uuid1, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH);

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_SCAN_RESULT;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = scan_result;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_cancel_scan(bluetooth_mesh_network_t *network)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_provision_device(bluetooth_mesh_provisioning_request_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_provisioning_result_t *prov_result = NULL;

	prov_result = g_malloc0(sizeof(bluetooth_mesh_provisioning_result_t));
	g_strlcpy(prov_result->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
	g_strlcpy(prov_result->dev_uuid, req->dev_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = prov_result;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_authentication_reply(int auth_type,
		const char *auth_val, gboolean reply)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_set_capabilities(bluetooth_mesh_network_t *network,
		bluetooth_mesh_provisioner_caps_t *caps)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_network_remove_group(bluetooth_mesh_network_t *network,
		bluetooth_mesh_network_group_info_t *req)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_browse_remote_node(bluetooth_mesh_node_discover_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_node_discover_t *node_result = NULL;

	node_result = g_malloc0(sizeof(bluetooth_mesh_node_discover_t));
	g_strlcpy(node_result->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
	g_strlcpy(node_result->dev_uuid, req->dev_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
	node_result->unicast = req->unicast;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_NODE_BROWSED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = node_result;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_node_browse_vendor_features(bluetooth_mesh_node_features_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_node_features_t *node_feature = NULL;

	node_feature = g_malloc0(sizeof(bluetooth_mesh_node_features_t));
	g_strlcpy(node_feature->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
	g_strlcpy(node_feature->dev_uuid, req->dev_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
	node_feature->unicast = req->unicast;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = node_feature;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_node_get_all_netkeys(bluetooth_mesh_node_discover_t *node, GPtrArray **netkeys)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_node_get_all_appkeys(bluetooth_mesh_node_discover_t *req, GPtrArray **appkeys)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_node_ttl_execute(bluetooth_mesh_node_ttl_info_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_node_ttl_info_t *node_ttl = NULL;

	node_ttl = g_malloc0(sizeof(bluetooth_mesh_node_ttl_info_t));
	g_strlcpy(node_ttl->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
	node_ttl->unicast = req->unicast;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = node_ttl;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_node_configure_key(bluetooth_mesh_key_configure_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_key_configure_t *node_config = NULL;

	node_config = g_malloc0(sizeof(bluetooth_mesh_key_configure_t));
	g_strlcpy(node_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
	node_config->primary_unicast = req->primary_unicast;
	node_config->is_netkey = req->is_netkey;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = node_config;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_node_reset(bluetooth_mesh_node_info_t *node)
{
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_model_configure_appkey(bluetooth_mesh_model_configure_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_model_configure_t *model_config = NULL;

	model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
	g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
	model_config->primary_unicast = req->primary_unicast;
	model_config->elem_index = req->elem_index;
	model_config->model = req->model;
	model_config->appkey_idx = req->appkey_idx;
	model_config->is_bind = req->is_bind;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = model_config;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_model_get_all_appkeys(bluetooth_mesh_model_configure_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_model_configure_t *model_config = NULL;

	model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
	g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
	model_config->primary_unicast = req->primary_unicast;
	model_config->elem_index = req->elem_index;
	model_config->model = req->model;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = model_config;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_model_configure_group_sub(bluetooth_mesh_model_configure_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_model_configure_t *model_config = NULL;

	model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
	g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
	model_config->primary_unicast = req->primary_unicast;
	model_config->elem_index = req->elem_index;
	model_config->model = req->model;
	model_config->op = req->op;
	model_config->sub_addr = req->sub_addr;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = model_config;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_model_configure_virtual_group_sub(bluetooth_mesh_model_configure_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_model_configure_t *model_config = NULL;

	model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
	g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
	model_config->primary_unicast = req->primary_unicast;
	model_config->elem_index = req->elem_index;
	model_config->model = req->model;
	model_config->op = req->op;
	model_config->sub_addr = req->sub_addr;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = model_config;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_model_get_subscriptopn_list(bluetooth_mesh_model_configure_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_model_configure_t *model_config = NULL;

	model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
	g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
	model_config->primary_unicast = req->primary_unicast;
	model_config->elem_index = req->elem_index;
	model_config->model = req->model;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = model_config;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_model_set_publication(bluetooth_mesh_model_configure_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_model_configure_t *model_config = NULL;

	model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
	g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
	model_config->primary_unicast = req->primary_unicast;
	model_config->elem_index = req->elem_index;
	model_config->model = req->model;
	model_config->appkey_idx = req->appkey_idx;
	model_config->pub_addr = req->pub_addr;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = model_config;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_model_get_publication(bluetooth_mesh_model_configure_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_model_configure_t *model_config = NULL;

	model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
	g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
	model_config->primary_unicast = req->primary_unicast;
	model_config->elem_index = req->elem_index;
	model_config->model = req->model;
	model_config->appkey_idx = req->appkey_idx;
	model_config->pub_addr = req->pub_addr;

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = model_config;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}

API int bluetooth_mesh_model_send_msg(bluetooth_mesh_model_msg_t *req)
{
	bluetooth_event_param_t *bt_event = NULL;
	bluetooth_mesh_model_msg_t *model_msg = NULL;

	model_msg = g_malloc0(sizeof(bluetooth_mesh_model_msg_t));
	g_strlcpy(model_msg->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
	model_msg->opcode = req->opcode;
	model_msg->primary_unicast = req->primary_unicast;
	model_msg->elem_index = req->elem_index;
	model_msg->appkey_idx = req->appkey_idx;
	model_msg->msg_len = req->msg_len;
	if (model_msg->msg_len > 0)
		memcpy(model_msg->msg, req->msg, req->msg_len + 1);

	bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
	bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED;
	bt_event->result = BLUETOOTH_ERROR_NONE;
	bt_event->param_data = model_msg;

	g_timeout_add(500, __mesh_event_cb, bt_event);
	return BLUETOOTH_ERROR_NONE;
}