aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/lib
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-23 10:21:06 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-11-02 16:12:26 +0100
commitbe188c31f2528cdabfffd07ef1ec87ff6c23330a (patch)
tree9a9dded7fd8348ff2abb71ed046963a1f9a811b7 /plugins/lib
parentcabdc828ee3eb35d780f2145fdb37081a5f6d71d (diff)
Use ctl defines to call afb functions
Use controller 'afb-defintions.h' defines to call application framework functions. Change-Id: If9599b0397a593440ce2e08f039dc279c63f7428 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'plugins/lib')
-rw-r--r--plugins/lib/bluetooth/hal-bt-cb.c14
-rw-r--r--plugins/lib/bluetooth/hal-bt.c77
2 files changed, 48 insertions, 43 deletions
diff --git a/plugins/lib/bluetooth/hal-bt-cb.c b/plugins/lib/bluetooth/hal-bt-cb.c
index 6ac9193..0638d50 100644
--- a/plugins/lib/bluetooth/hal-bt-cb.c
+++ b/plugins/lib/bluetooth/hal-bt-cb.c
@@ -36,7 +36,7 @@ void HalBtGetStreamingStatus(AFB_ReqT request)
{
struct HalBtPluginData *localHalBtPluginData;
- if(! (localHalBtPluginData = (struct HalBtPluginData *) afb_request_get_vcbdata(request))) {
+ if(! (localHalBtPluginData = (struct HalBtPluginData *) AFB_ReqVCBData(request))) {
AFB_ReqFail(request, "bt_plugin_data", "Can't get bluetooth plugin data");
return;
}
@@ -54,7 +54,7 @@ void HalBtSetStreamingStatus(AFB_ReqT request)
AFB_ApiT apiHandle;
- if(! (localHalBtPluginData = (struct HalBtPluginData *) afb_request_get_vcbdata(request))) {
+ if(! (localHalBtPluginData = (struct HalBtPluginData *) AFB_ReqVCBData(request))) {
AFB_ReqFail(request, "bt_plugin_data", "Can't get bluetooth plugin data");
return;
}
@@ -64,7 +64,7 @@ void HalBtSetStreamingStatus(AFB_ReqT request)
return;
}
- if(! (apiHandle = (AFB_ApiT ) afb_request_get_dynapi(request))) {
+ if(! (apiHandle = (AFB_ApiT ) AFB_ReqGetApi(request))) {
AFB_ReqFail(request, "api_handle", "Can't get current hal controller api handle");
return;
}
@@ -99,7 +99,7 @@ void HalBtGetA2DPBluetoothDevices(AFB_ReqT request)
json_object *requestAnswer, *currentBtDeviceObjectJ;
- if(! (localHalBtPluginData = (struct HalBtPluginData *) afb_request_get_vcbdata(request))) {
+ if(! (localHalBtPluginData = (struct HalBtPluginData *) AFB_ReqVCBData(request))) {
AFB_ReqFail(request, "bt_plugin_data", "Can't get bluetooth plugin data");
return;
}
@@ -135,7 +135,7 @@ void HalBtGetSelectedA2DPBluetoothDevice(AFB_ReqT request)
json_object *selectedBtDeviceObject;
- if(! (localHalBtPluginData = (struct HalBtPluginData *) afb_request_get_vcbdata(request))) {
+ if(! (localHalBtPluginData = (struct HalBtPluginData *) AFB_ReqVCBData(request))) {
AFB_ReqFail(request, "bt_plugin_data", "Can't get bluetooth plugin data");
return;
}
@@ -165,7 +165,7 @@ void HalBtSetSelectedA2DPBluetoothDevice(AFB_ReqT request)
AFB_ApiT apiHandle;
- if(! (localHalBtPluginData = (struct HalBtPluginData *) afb_request_get_vcbdata(request))) {
+ if(! (localHalBtPluginData = (struct HalBtPluginData *) AFB_ReqVCBData(request))) {
AFB_ReqFail(request, "bt_plugin_data", "Can't get bluetooth plugin data");
return;
}
@@ -175,7 +175,7 @@ void HalBtSetSelectedA2DPBluetoothDevice(AFB_ReqT request)
return;
}
- if(! (apiHandle = (AFB_ApiT ) afb_request_get_dynapi(request))) {
+ if(! (apiHandle = (AFB_ApiT ) AFB_ReqGetApi(request))) {
AFB_ReqFail(request, "api_handle", "Can't get current hal controller api handle");
return;
}
diff --git a/plugins/lib/bluetooth/hal-bt.c b/plugins/lib/bluetooth/hal-bt.c
index a4791e1..3f38012 100644
--- a/plugins/lib/bluetooth/hal-bt.c
+++ b/plugins/lib/bluetooth/hal-bt.c
@@ -64,7 +64,7 @@ CTLP_INIT(plugin, callbacks)
return 0;
}
- if(! (ctrlConfig = (CtlConfigT *) afb_dynapi_get_userdata(plugin->api))) {
+ if(! (ctrlConfig = (CtlConfigT *) AFB_ApiGetUserData(plugin->api))) {
AFB_ApiError(plugin->api, "Can't get current hal controller config");
return -1;
}
@@ -232,57 +232,62 @@ CTLP_CAPI(init, source, argsJ, queryJ)
AFB_ApiInfo(source->api, "Controller onload initialization of %s plugin", HAL_BT_PLUGIN_NAME);
// Loading hal BT plugin specific verbs
- if(afb_dynapi_add_verb(source->api,
- HAL_BT_GET_STREAMING_STATUS_VERB,
- "Get Bluetooth streaming status",
- HalBtGetStreamingStatus,
- (void *) &localHalBtPluginData,
- NULL,
- 0)) {
+ if(AFB_ApiAddVerb(source->api,
+ HAL_BT_GET_STREAMING_STATUS_VERB,
+ "Get Bluetooth streaming status",
+ HalBtGetStreamingStatus,
+ (void *) &localHalBtPluginData,
+ NULL,
+ 0,
+ 0)) {
AFB_ApiError(source->api, "Error while creating verb for bluetooth plugin : '%s'", HAL_BT_GET_STREAMING_STATUS_VERB);
return -1;
}
- if(afb_dynapi_add_verb(source->api,
- HAL_BT_SET_STREAMING_STATUS_VERB,
- "Set Bluetooth streaming status",
- HalBtSetStreamingStatus,
- (void *) &localHalBtPluginData,
- NULL,
- 0)) {
+ if(AFB_ApiAddVerb(source->api,
+ HAL_BT_SET_STREAMING_STATUS_VERB,
+ "Set Bluetooth streaming status",
+ HalBtSetStreamingStatus,
+ (void *) &localHalBtPluginData,
+ NULL,
+ 0,
+ 0)) {
AFB_ApiError(source->api, "Error while creating verb for bluetooth plugin : '%s'", HAL_BT_SET_STREAMING_STATUS_VERB);
return -2;
}
- if(afb_dynapi_add_verb(source->api,
- HAL_BT_GET_CONNECTED_A2DP_DEVICES_VERB,
- "Get connected Bluetooth A2DP devices list",
- HalBtGetA2DPBluetoothDevices,
- (void *) &localHalBtPluginData,
- NULL,
- 0)) {
+ if(AFB_ApiAddVerb(source->api,
+ HAL_BT_GET_CONNECTED_A2DP_DEVICES_VERB,
+ "Get connected Bluetooth A2DP devices list",
+ HalBtGetA2DPBluetoothDevices,
+ (void *) &localHalBtPluginData,
+ NULL,
+ 0,
+ 0)) {
AFB_ApiError(source->api, "Error while creating verb for bluetooth plugin : '%s'", HAL_BT_GET_CONNECTED_A2DP_DEVICES_VERB);
return -3;
}
- if(afb_dynapi_add_verb(source->api,
- HAL_BT_GET_SELECTED_A2DP_DEVICE_VERB,
- "Get selected Bluetooth A2DP device",
- HalBtGetSelectedA2DPBluetoothDevice,
- (void *) &localHalBtPluginData,
- NULL,
- 0)) {
+ if(AFB_ApiAddVerb(source->api,
+ HAL_BT_GET_SELECTED_A2DP_DEVICE_VERB,
+ "Get selected Bluetooth A2DP device",
+ HalBtGetSelectedA2DPBluetoothDevice,
+ (void *) &localHalBtPluginData,
+ NULL,
+ 0,
+ 0)) {
AFB_ApiError(source->api, "Error while creating verb for bluetooth plugin : '%s'", HAL_BT_GET_SELECTED_A2DP_DEVICE_VERB);
return -4;
}
- if(afb_dynapi_add_verb(source->api,
- HAL_BT_SET_SELECTED_A2DP_DEVICE_VERB,
- "Set selected Bluetooth A2DP device",
- HalBtSetSelectedA2DPBluetoothDevice,
- (void *) &localHalBtPluginData,
- NULL,
- 0)) {
+ if(AFB_ApiAddVerb(source->api,
+ HAL_BT_SET_SELECTED_A2DP_DEVICE_VERB,
+ "Set selected Bluetooth A2DP device",
+ HalBtSetSelectedA2DPBluetoothDevice,
+ (void *) &localHalBtPluginData,
+ NULL,
+ 0,
+ 0)) {
AFB_ApiError(source->api, "Error while creating verb for bluetooth plugin : '%s'", HAL_BT_SET_SELECTED_A2DP_DEVICE_VERB);
return -5;
}