Initialize Tizen 2.3 tizen_2.3 2.3a_release submit/tizen_2.3/20140531.111239
authorSehong Na <sehong.na@samsung.com>
Sat, 31 May 2014 03:59:55 +0000 (12:59 +0900)
committerSehong Na <sehong.na@samsung.com>
Sat, 31 May 2014 03:59:55 +0000 (12:59 +0900)
33 files changed:
CMakeLists.txt [new file with mode: 0644]
Copyright [new file with mode: 0644]
files/EFL_com.developer.samsung.tizen.privilege.samsung.accessory.protocol.smack [new file with mode: 0644]
files/arm/bin/ft-service [new file with mode: 0755]
files/arm/bin/sap-server [new file with mode: 0755]
files/arm/lib/libsap-api.so [new symlink]
files/arm/lib/libsap-api.so.1 [new symlink]
files/arm/lib/libsap-api.so.1.0.0 [new file with mode: 0755]
files/arm/lib/libsap-client-stub-api.so [new symlink]
files/arm/lib/libsap-client-stub-api.so.1 [new symlink]
files/arm/lib/libsap-client-stub-api.so.1.0.0 [new file with mode: 0755]
files/arm/lib/libwsm.so [new file with mode: 0644]
files/file-transfer.xml [new file with mode: 0644]
files/frameworkPolicyDelgate.xml [new file with mode: 0644]
files/include/FTInterface.h [new file with mode: 0644]
files/include/SAPDeviceInterface.h [new file with mode: 0644]
files/include/SAPInterface.h [new file with mode: 0644]
files/sap-api.pc [new file with mode: 0644]
files/sap-client-stub-api.pc [new file with mode: 0644]
files/x86/bin/ft-service [new file with mode: 0755]
files/x86/bin/sap-server [new file with mode: 0755]
files/x86/lib/libsap-api.so [new symlink]
files/x86/lib/libsap-api.so.1 [new symlink]
files/x86/lib/libsap-api.so.1.0.0 [new file with mode: 0755]
files/x86/lib/libsap-client-stub-api.so [new symlink]
files/x86/lib/libsap-client-stub-api.so.1 [new symlink]
files/x86/lib/libsap-client-stub-api.so.1.0.0 [new file with mode: 0755]
files/x86/lib/libwsm.so [new file with mode: 0644]
packaging/ft.service [new file with mode: 0644]
packaging/sap.manifest [new file with mode: 0644]
packaging/sap.service [new file with mode: 0644]
packaging/sap.spec [new file with mode: 0644]
packaging/sap.target [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..fddd54a
--- /dev/null
@@ -0,0 +1,19 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(sap-stack C)
+
+IF(ARM_TARGET)
+       INSTALL(FILES files/arm/bin/sap-server DESTINATION ${BIN_INSTALL_DIR})
+       INSTALL(FILES files/arm/bin/ft-service DESTINATION ${BIN_INSTALL_DIR})
+       INSTALL(DIRECTORY files/arm/lib/ DESTINATION ${LIB_INSTALL_DIR})
+ELSE(ARM_TARGET)
+       INSTALL(FILES files/x86/bin/sap-server DESTINATION ${BIN_INSTALL_DIR})
+       INSTALL(FILES files/x86/bin/ft-service DESTINATION ${BIN_INSTALL_DIR})
+       INSTALL(DIRECTORY files/x86/lib/ DESTINATION ${LIB_INSTALL_DIR})
+ENDIF(ARM_TARGET)
+
+INSTALL(DIRECTORY files/include/ DESTINATION ${INCLUDE_INSTALL_DIR}/sap-service FILES_MATCHING PATTERN "*.h")
+INSTALL(FILES files/sap-api.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+INSTALL(FILES files/sap-client-stub-api.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+INSTALL(FILES files/file-transfer.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appcessory)
+INSTALL(FILES files/frameworkPolicyDelgate.xml DESTINATION ${BIN_INSTALL_DIR})
+INSTALL(FILES files/EFL_com.developer.samsung.tizen.privilege.samsung.accessory.protocol.smack DESTINATION ${SHARE_INSTALL_PREFIX}/privilege-control)
diff --git a/Copyright b/Copyright
new file mode 100644 (file)
index 0000000..df3a6f2
--- /dev/null
+++ b/Copyright
@@ -0,0 +1,6 @@
+Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of SAMSUNG ELECTRONICS ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the license agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no representations or warranties about the suitability of the software, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAMSUNG shall not be liable for any damages suffered by licensee as a result of using, modifying or distributing this software or its derivatives.
+
diff --git a/files/EFL_com.developer.samsung.tizen.privilege.samsung.accessory.protocol.smack b/files/EFL_com.developer.samsung.tizen.privilege.samsung.accessory.protocol.smack
new file mode 100644 (file)
index 0000000..5e0871a
--- /dev/null
@@ -0,0 +1,2 @@
+~APP~ sap w
+~APP~ sap::vconf rl
diff --git a/files/arm/bin/ft-service b/files/arm/bin/ft-service
new file mode 100755 (executable)
index 0000000..43cde85
Binary files /dev/null and b/files/arm/bin/ft-service differ
diff --git a/files/arm/bin/sap-server b/files/arm/bin/sap-server
new file mode 100755 (executable)
index 0000000..f92ccfe
Binary files /dev/null and b/files/arm/bin/sap-server differ
diff --git a/files/arm/lib/libsap-api.so b/files/arm/lib/libsap-api.so
new file mode 120000 (symlink)
index 0000000..f5066df
--- /dev/null
@@ -0,0 +1 @@
+libsap-api.so.1
\ No newline at end of file
diff --git a/files/arm/lib/libsap-api.so.1 b/files/arm/lib/libsap-api.so.1
new file mode 120000 (symlink)
index 0000000..2388d9a
--- /dev/null
@@ -0,0 +1 @@
+libsap-api.so.1.0.0
\ No newline at end of file
diff --git a/files/arm/lib/libsap-api.so.1.0.0 b/files/arm/lib/libsap-api.so.1.0.0
new file mode 100755 (executable)
index 0000000..228a5df
Binary files /dev/null and b/files/arm/lib/libsap-api.so.1.0.0 differ
diff --git a/files/arm/lib/libsap-client-stub-api.so b/files/arm/lib/libsap-client-stub-api.so
new file mode 120000 (symlink)
index 0000000..cfbb315
--- /dev/null
@@ -0,0 +1 @@
+libsap-client-stub-api.so.1
\ No newline at end of file
diff --git a/files/arm/lib/libsap-client-stub-api.so.1 b/files/arm/lib/libsap-client-stub-api.so.1
new file mode 120000 (symlink)
index 0000000..dc0dedd
--- /dev/null
@@ -0,0 +1 @@
+libsap-client-stub-api.so.1.0.0
\ No newline at end of file
diff --git a/files/arm/lib/libsap-client-stub-api.so.1.0.0 b/files/arm/lib/libsap-client-stub-api.so.1.0.0
new file mode 100755 (executable)
index 0000000..3a298ec
Binary files /dev/null and b/files/arm/lib/libsap-client-stub-api.so.1.0.0 differ
diff --git a/files/arm/lib/libwsm.so b/files/arm/lib/libwsm.so
new file mode 100644 (file)
index 0000000..abb0e1d
Binary files /dev/null and b/files/arm/lib/libwsm.so differ
diff --git a/files/file-transfer.xml b/files/file-transfer.xml
new file mode 100644 (file)
index 0000000..01c5804
--- /dev/null
@@ -0,0 +1,72 @@
+<!DOCTYPE resources [
+<!ELEMENT resources (application)>
+<!ELEMENT application (serviceProfile)+>
+<!ELEMENT supportedTransports (transport)+>
+<!ELEMENT serviceProfile (supportedTransports, serviceChannel+) >
+<!ELEMENT transport EMPTY> 
+<!ELEMENT serviceChannel EMPTY> 
+<!ATTLIST application name CDATA #REQUIRED>
+<!ATTLIST application xmlns:android CDATA #IMPLIED>
+<!ATTLIST serviceProfile xmlns:android CDATA #IMPLIED>
+<!ATTLIST serviceProfile serviceImpl CDATA #REQUIRED>
+<!ATTLIST serviceProfile role (provider | consumer) #REQUIRED>
+<!ATTLIST serviceProfile name CDATA #REQUIRED> 
+<!ATTLIST serviceProfile id CDATA #REQUIRED>
+<!ATTLIST serviceProfile version CDATA #REQUIRED>
+<!ATTLIST serviceProfile serviceLimit (ANY | ONE_ACCESSORY | ONE_PEERAGENT | any | one_accessory | one_peeragent)  "ANY">
+<!ATTLIST serviceProfile serviceTimeout CDATA #IMPLIED>
+<!ATTLIST supportedTransports xmlns:android CDATA #IMPLIED>
+<!ATTLIST transport xmlns:android CDATA #IMPLIED>
+<!ATTLIST transport type (TRANSPORT_WIFI|TRANSPORT_BT|TRANSPORT_BLE|TRANSPORT_USB |transport_wifi|transport_bt|transport_ble|transport_usb) #REQUIRED>
+<!ATTLIST serviceChannel xmlns:android CDATA #IMPLIED>
+<!ATTLIST serviceChannel id CDATA #REQUIRED>
+<!ATTLIST serviceChannel dataRate (Low | High | low | high) #REQUIRED>
+<!ATTLIST serviceChannel priority (Low | Medium | High | low | medium | high) #REQUIRED>
+<!ATTLIST serviceChannel reliability (enable | disable | ENABLE | DISABLE ) #REQUIRED>
+]>
+
+
+<resources>
+    <application name="/usr/bin/ft-service">
+           <serviceProfile
+               id="/system/filetransfer"
+               name="FTReceiver"
+               role="consumer"
+               serviceImpl="/usr/bin/ft-service"
+               version="1.0">
+               <supportedTransports>
+                               <transport type="TRANSPORT_BT"/>
+               </supportedTransports>
+               <serviceChannel
+                   id="100"
+                dataRate="Low"
+                priority="High"
+                reliability="enable" />
+            <serviceChannel
+                   id="101"
+                dataRate="Low"
+                priority="Low"
+                reliability="enable" />
+           </serviceProfile>
+               <serviceProfile
+                       id="/system/filetransfer"
+               name="FTSender"
+               role="provider"
+               serviceImpl="/usr/bin/ft-service"
+               version="1.0">
+               <supportedTransports>
+                               <transport type="TRANSPORT_BT"/>
+               </supportedTransports>
+               <serviceChannel
+                   id="100"
+                dataRate="Low"
+                priority="High"
+                reliability="enable" />
+            <serviceChannel
+                   id="101"
+                dataRate="Low"
+                priority="Low"
+                reliability="enable" />
+           </serviceProfile>
+       </application>
+</resources>
diff --git a/files/frameworkPolicyDelgate.xml b/files/frameworkPolicyDelgate.xml
new file mode 100644 (file)
index 0000000..6e22fd7
--- /dev/null
@@ -0,0 +1,3 @@
+<resources>\r
+</resources>\r
+\r
diff --git a/files/include/FTInterface.h b/files/include/FTInterface.h
new file mode 100644 (file)
index 0000000..8e99bd7
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * PROPRIETARY/CONFIDENTIAL
+ *
+ * This software is the confidential and proprietary information of SAMSUNG
+ * ELECTRONICS ("Confidential Information"). You shall not disclose such
+ * Confidential Information and shall use it only in accordance with the terms
+ * of the license agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG
+ * make no representations or warranties about the suitability of the software,
+ * either express or implied, including but not limited to the implied
+ * warranties of merchantability, fitness for a particular purpose, or
+ * non-infringement. SAMSUNG shall not be liable for any damages suffered by
+ * licensee as a result of using, modifying or distributing this software or
+ * its derivatives.
+ * licensee arising out of or related to this software.
+ *
+ */
+#ifndef _FTINTERFACE_H_
+#define _FTINTERFACE_H_
+
+#include "SAPInterface.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/***************************************************************************//**
+ @brief  The enum defines the status codes that may be used to convey generic result codes as needed for FT interaction.
+ @param  TRANSFER_SUCCESS: FT Transfer is successfull.
+ @param  TRANSFER_COMPLETE_FAIL_FILE_IO: This error is received when the file to be sent/received doesn't exist or the path is invalid
+ @param  TRANSFER_COMPLETE_FAIL_PEER_UNRESPONSIVE: This error is received during file transfer the remote end is unresponsive
+ @param  TRANSFER_COMPLETE_FAIL_PEER_CONN_LOST: This error is received when during file transfer service connection was lost (e.g. could be due to BT off)
+ @param  TRANSFER_COMPLETE_FAIL_PEER_CANCELLED: This error is received when peer cancelled file transfer
+ @param  TRANSFER_COMPLETE_FAIL_SPACE_NOT_AVAILABLE: This error is received when peer doesn't have enough space to store the file
+ ****************************************************************************/
+typedef enum tagFTResultVal
+{
+       TRANSFER_SUCCESS = 0,
+       TRANSFER_COMPLETE_FAIL_CHANNEL_IO = 1,
+       TRANSFER_COMPLETE_FAIL_FILE_IO = 2,
+       TRANSFER_COMPLETE_FAIL_CMD_DROPPED = 3,
+       TRANSFER_COMPLETE_FAIL_PEER_UNRESPONSIVE = 4,
+       TRANSFER_COMPLETE_FAIL_PEER_CONN_LOST = 5,
+       TRANSFER_COMPLETE_FAIL_PEER_CANCELLED = 9,
+       TRANSFER_COMPLETE_FAIL_SPACE_NOT_AVAILABLE = 11
+}FT_RESULT_VAL;
+
+/*********************************************************************************//**
+ @brief  The function sendFile is called by app to send a file
+ @param pFilePath [in]: this is absolute file path for file to be send. If file doesn't exist, permission denied or invalid path,
+               App will be notified in FDefOnSendComplete() with error code TRANSFER_COMPLETE_FAIL_FILE_IO
+ @param pPeerAgent [in]: Peer Agent to which file is to be sent
+ @returns : returns file transfer dwTransactionId - Application should store this transaction id to track status of file transfer
+ ****************************************************************************/
+int sendFile(char* pFilePath, PeerAgent* pPeerAgent);
+
+/*********************************************************************************//**
+ @brief  The function pushFile is called by app, which has multiple profile implementations in a single app.
+ @param pFilePath [in]: this is absolute file path for file to be send. If file doesn't exist, permission denied or invalid path,
+               App will be notified in FDefOnSendComplete() with error code TRANSFER_COMPLETE_FAIL_FILE_IO
+ @param pPeerAgent [in]: Peer Agent to which file is to be sent
+ @param dwLocalAgentId [in]: Local agent ID of the agent which intents to use file transfer utility.
+ @returns : returns file transfer dwTransactionId - Application should store this transaction id to track status of file transfer
+ ****************************************************************************/
+int pushFile(char* pFilePath, PeerAgent* pPeerAgent, unsigned int dwLocalAgentId);
+
+/**************************************************************************//**
+ @brief  The function receiveFile is called by app to accept/reject a file req
+ @param dwTransactionId [in]: file transfer transaction Id
+ @param pFilePath [in]: this is absolute file path where file to be saved. If file path is invalid,
+               permission denied App will be notified in FDefOnReceiveComplete() with error code TRANSFER_COMPLETE_FAIL_FILE_IO
+ @param wConfirmReceive [in]: accept/reject status, for accept set 1, for reject set 0
+ @returns : returns SAP_RESULT_VAL with SAP_SUCCESS in case of success and appropriate failure error if any error as per the SAP_STATUS_CODE ENUM
+ ****************************************************************************/
+SAP_RESULT_VAL receiveFile(int dwTransactionId, char* pFilePath, short int wConfirmReceive);
+
+/**************************************************************************//**
+ @brief  The function cancelFile is called by app to cancel the file transfer
+ @param dwTransactionId [in]: transaction Id - Identifies the File transfer transaction to be cancelled
+               file sender App will receive this transaction Id as return value of sendFile()
+               file receiver App will receive this transaction Id in FDefOnSendFile()
+  @returns : returns SAP_RESULT_VAL with SAP_SUCCESS in case of success and appropriate failure error if any error as per the SAP_STATUS_CODE ENUM
+ ****************************************************************************/
+SAP_RESULT_VAL cancelFile(int dwTransactionId);
+
+/**************************************************************************//**
+ @brief This callback function gets triggered when App receive a file req
+ @param dwTransactionId [in]: transaction Id for file transfer
+ @param pFilePath [in] : This is source file path at sender side
+               Receiver will call receiveFile() to accept/reject the file transfer request
+               In receiveFile(), pFilePath is destination file path (Note: Since source file path could be from different File System,
+               call receiveFile with a path valid in destination File System. Application should take care of this)
+ @param dwAgentId [in]:  Agent ID to which the call back is intended.
+ @returns : returns void.
+* ***************************************************************************/
+typedef  void (*FDefOnSendFile) (int dwTransactionId, char* pFilePath, unsigned int dwAgentId);
+
+
+/**************************************************************************//**
+ @brief This callback function gets triggered when sending file  is completed or error occurred during File transfer
+ @param dwTransactionId [in]: transaction ID for file transfer
+ @param pFilePath [in] : file path.
+ @param uwResult [in] : FT_RESULT_VAL: TRANSFER_SUCCESS if transfer is successful or appropriate Error code
+ @param dwAgentId [in]:  Agent ID to which the call back is intended.
+ @returns : returns void
+* ***************************************************************************/
+typedef  void (*FDefOnSendComplete) (int dwTransactionId, char* pFilePath, unsigned short int uwResult, unsigned int dwAgentId);
+
+/**************************************************************************//**
+ @brief This callback function gets triggered when receive file is completed
+ @param dwTransactionId [in]: transaction ID for file transfer
+ @param pFilePath [in] : Received file path
+ @param uwResult [in] : FT_RESULT_VAL: TRANSFER_SUCCESS if transfer is successful or appropriate Error code
+ @param dwAgentId [in]:  Agent ID to which the call back is intended.
+ @returns : returns void
+* ***************************************************************************/
+typedef  void (*FDefOnReceiveComplete) (int dwTransactionId, char* pFilePath, unsigned short int uwResult, unsigned int dwAgentId);
+
+
+/**************************************************************************//**
+ @brief This callback function gets triggered to update file progress status to App
+ @param dwTransactionId [in]: transaction ID for file transfer
+ @param uwProgress [in] : send/receive file progress expressed as % (e.g. 10%, 90%)
+ @param dwAgentId [in]:  Agent ID to which the call back is intended.
+ @returns : returns void
+* ***************************************************************************/
+typedef  void (*FDefOnFileProgress) (int dwTransactionId, unsigned short int uwProgress, unsigned int dwAgentId);
+
+
+/***************************************************************************//**
+ @brief  The structure  tagFTNotification holds references to callback for application for various events from framework for file transfer
+ @param  pFDefOnSendFile: Callback to indicate incoming file transfer request
+ @param  pFDefOnSendComplete: Callback to indicate status of send file  (both success and error)
+ @param  pFDefOnReceiveComplete: Callback to indicate status of receive file  (both success and error)
+ @param  pFDefOnFileProgress: Callback to indicate progress of file transfer
+ ****************************************************************************/
+typedef struct tagFTNotification
+{
+       FDefOnSendFile pFDefOnSendFile;///<Register on send file request function pointer
+       FDefOnSendComplete pFDefOnSendComplete;///<Register on send complete function pointer
+       FDefOnReceiveComplete pFDefOnReceiveComplete;///<Register on receive complete function pointer
+       FDefOnFileProgress pFDefOnFileProgress;///<Register on file progress function pointer
+}FTNotification;
+
+/**************************************************************************//**
+@brief This function registers all the callbacks in FTNotification. This API needs to be called from the App to get File Transfer notifications.
+@param FTNotiFuncs [in] : Notification functions which are to be registered for getting callback.
+@returns : returns void
+* ***************************************************************************/
+void registerFTNotifications(FTNotification FTNotiFuncs);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_FTINTERFACE_H_ */
+
diff --git a/files/include/SAPDeviceInterface.h b/files/include/SAPDeviceInterface.h
new file mode 100644 (file)
index 0000000..650f0e9
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * PROPRIETARY/CONFIDENTIAL
+ *
+ * This software is the confidential and proprietary information of SAMSUNG
+ * ELECTRONICS ("Confidential Information"). You shall not disclose such
+ * Confidential Information and shall use it only in accordance with the terms
+ * of the license agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG
+ * make no representations or warranties about the suitability of the software,
+ * either express or implied, including but not limited to the implied
+ * warranties of merchantability, fitness for a particular purpose, or
+ * non-infringement. SAMSUNG shall not be liable for any damages suffered by
+ * licensee as a result of using, modifying or distributing this software or
+ * its derivatives.
+ * licensee arising out of or related to this software.
+ *
+ */
+#ifndef _SAPDEVICEINTERFACE_H_
+#define _SAPDEVICEINTERFACE_H_
+
+#include "SAPInterface.h"
+
+
+typedef enum PeerDeviceConnectResponseCode{
+
+    DEVICE_CONNECTED,
+    DEVICE_CONNECTION_EXISTS,
+    DEVICE_CONNECT_FAILURE
+
+}PeerDeviceConnectResponseCode;
+
+
+
+/***************************************************************************//**
+ @brief  The structure  tagPeerConnect is used to store the details associated with a specific device for Peer Device Connection
+ @param  ulTransactionId: TransactionID
+ @param  pchPeerDeviceName: Device name
+ @param  ubPeerDeviceConnectionType: Connectivity types as defined in the ConnectivityType enum in SAPInterface.h
+ @param  pvPeerDeviceConnectionParameters: Connectivity specific parameters for connection. IP & Port address for TCP & MACID for BT. To be passed as a byte array
+                                       in case of BT : MACID,UUID,ROLE (each separated by comma) eg : "00:02:60:00:13:68,c69fd3b8-0a41-11e3-9282-f23c91aec05e,1" Role is 1 for server and 2 for client
+                                       in case of TCP : IP,Port,Role (each separated by comma and each tuple inside IP separated by ".") eg : "107.109.107.228,26871,1"
+
+ ****************************************************************************/
+typedef struct tagPeerConnect
+{
+       unsigned int ulTransactionId;///< TransactionID
+       char *pchPeerDeviceName;///< Device name
+       unsigned char ubPeerDeviceConnectionType;///< Connectivity types as defined in the ConnectivityType enum in SAPInterface.h
+       void* pvPeerDeviceConnectionParameters;///< Connectivity specific parameters for connection. IP & Port address for TCP & MACID for BT. To be passed as a byte array
+}PeerConnect;
+
+/**************************************************************************//**
+@brief This function is called by the application for connecting with the peer device.
+@param pPeerConnectRequest [in]   : PeerConnect Request
+@returns : returns SAP_STATUS_CODE with SAP_SUCCESS in case of successfully intiated registration or appropriate failure error if any error as per the SAP_STATUS_CODE ENUM.
+@remarks: registerDeviceNotifications needs to be called prior to calling this API.
+* ************************************************************************** */
+SAP_RESULT_VAL peerDeviceConnect(PeerConnect *pPeerConnectRequest);
+
+/**************************************************************************//**
+ @brief This callback function gets triggered after peer device connection is completed.
+ @param wStatusCode [in]   : SAP_STATUS_CODE shall be returned with SAP_SUCCESS in case of success and appropriate error code in case of failure.
+ @param ulTrsactionID [in] : TransactionID provided by the app.
+ @param ulPeerDeviceID [in] : Peer Device Id as generated by the framework
+**************************************************************************** */
+typedef void (*FDefOnPeerConnectConfirm)(unsigned int ulPeerDeviceID,unsigned int ulTransactionID, PeerDeviceConnectResponseCode  wStatusCode);
+
+
+/**************************************************************************//**
+@brief This function is called by the application for disconnecting with the peer device.
+@param ulPeerDeviceID [in]   : ID of the device to be disconnected.
+@param ulTransactionID [in] : Transaction ID
+@returns : returns SAP_STATUS_CODE with SAP_SUCCESS in case of successfully intiated registration or appropriate failure error if any error as per the SAP_STATUS_CODE ENUM.
+* ************************************************************************** */
+SAP_RESULT_VAL peerDeviceDisconnect(unsigned int ulPeerDeviceID,unsigned int ulTransactionID);
+
+
+/**************************************************************************//**
+ @brief This callback function gets triggered after peer device disconnection is completed.
+ @param wStatusCode [in]   : SAP_STATUS_CODE shall be returned with SAP_SUCCESS in case of success and appropriate error code in case of failure.
+ @param ulTransactionID [in] : ulTransactionID
+**************************************************************************** */
+typedef void (*FDefOnPeerDisconnectConfirm)(unsigned int ulTransactionID,int wStatusCode);
+
+
+/***************************************************************************//**
+ @brief  The structure  holds references to callback for application for various events from framework.
+ @param  pfnOnPeerConnectConfirm: Peer Device Connection Confirmation function pointer
+ @param  pfnOnPeerDisconnectConfirm: Peer Device Disconnect Confirmation function pointer
+ ****************************************************************************/
+typedef struct tagSAPDeviceNotification
+{
+       FDefOnPeerConnectConfirm pfnOnPeerConnectConfirm; ///< Peer Device Connection Confirmation function pointer
+       FDefOnPeerDisconnectConfirm pfnOnPeerDisconnectConfirm;///< Peer Device Disconnect Confirmation function pointer
+}SAPDeviceNotification;
+
+/**************************************************************************//**
+@brief This function registers all the callbacks in SAPDMENotification. This needs to be the first API that needs to be called from the App.
+@param notiDMEfuncs [in]   : Notification functions which are to be registered for getting callback.
+@returns : returns SAP_STATUS_CODE with SAP_SUCCESS in case of success and appropriate failure error if any error as per the SAP_STATUS_CODE ENUM.
+* ************************************************************************** */
+SAP_RESULT_VAL registerDeviceNotifications(SAPDeviceNotification notiDevicefuncs);
+
+#endif /*_SAPDEVICEINTERFACE_H_*/
diff --git a/files/include/SAPInterface.h b/files/include/SAPInterface.h
new file mode 100644 (file)
index 0000000..4feff1d
--- /dev/null
@@ -0,0 +1,601 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * PROPRIETARY/CONFIDENTIAL
+ *
+ * This software is the confidential and proprietary information of SAMSUNG
+ * ELECTRONICS ("Confidential Information"). You shall not disclose such
+ * Confidential Information and shall use it only in accordance with the terms
+ * of the license agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG
+ * make no representations or warranties about the suitability of the software,
+ * either express or implied, including but not limited to the implied
+ * warranties of merchantability, fitness for a particular purpose, or
+ * non-infringement. SAMSUNG shall not be liable for any damages suffered by
+ * licensee as a result of using, modifying or distributing this software or
+ * its derivatives.
+ * licensee arising out of or related to this software.
+ *
+ */
+#ifndef _SAPINTERFACE_H_
+#define _SAPINTERFACE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/***************************************************************************//**
+ @brief  The enum defines the event codes for the Incremental Update Notification .
+ @param  PEER_UNAVAILABLE: Defines that the peer has been uninstalled or Deregistered
+ @param  PEER_AVAILABLE: Defines that the peer is installed or registered
+ ****************************************************************************/
+typedef enum PeerStatus{
+       PEER_AGENT_UNAVAILABLE,   ///<  Defines that the peer has been uninstalled or Deregistered
+       PEER_AGENT_AVAILABLE       ///< Defines that the peer is installed or registered
+}PeerStatus;
+
+/***************************************************************************//**
+ @brief  The enum defines the event codes for Broadcast Event from SAP.
+ @param  DEVICE_ATTACH_EVENT : Device Attach Compeleted.
+ ****************************************************************************/
+typedef enum BroadcastEvent
+{
+       DEVICE_ATTACH_EVENT = 0
+}BroadcastEvent;
+
+
+enum device_status{
+
+       DEVICE_DETACHED = 0x00, /// device detached
+       DEVICE_ATTACHED = 0x01  /// device attached
+};
+//3 TBD: One of the above should be finalised after complete review.
+
+
+/***************************************************************************//**
+ @brief  The enum defines the SAP Service Agent roles for Providers and Consumers across Peer Devices.
+ @param  SERVICE_AGENT_ROLE_PROVIDER: The SERVICE AGENT PROVIDER Role can be played by an application connecting to SAP in order to achieve the service objectives, like accept/reject a service connection from a SERVICE AGENT CONSUMER and send/receive data.
+ @param  SERVICE_AGENT_ROLE_CONSUMER: The SERVICE AGENT CONSUMER Role can be played by an application connecting to SAP in order to achieve the service objectives, like request a service connection to a SERVICE AGENT PROVIDER and send/receive data.
+ ****************************************************************************/
+typedef enum ServiceAgentRole {
+
+       SERVICE_AGENT_ROLE_PROVIDER = 0,
+       SERVICE_AGENT_ROLE_CONSUMER = 1
+}ServiceAgentRole;
+
+
+/***************************************************************************//**
+ @brief  The enum defines the result of Service Connection Creation
+ @param  CONNECTION_SUCCESS: Service Connection is successful. App can continue to send Data using sendData()
+ @param         CONNECTION_ALREADY_EXIST: Service Connection  already exists. Connection already exist use the same. If sendData fails again, create new connection
+ @param  CONNECTION_FAILURE_DEVICE_UNREACHABLE: Device is not reachable. It is not connected or connection is lost. Need to wait for connection again to retry
+ @param  CONNECTION_FAILURE_INVALID_PEERAGENT: The peer agent details (peer ID etc.) are invalid. Peer Agent is invalid, so do findPeerAgent() again and retry service connection
+ @param  CONNECTION_FAILURE_NETWORK: Connection failed due to network error. Try again. If error keeps happening, wait for connection and then retry.
+ @param  CONNECTION_FAILURE_PEERAGENT_NO_RESPONSE: The remote peer did not response to request. Since there is no response from peer, the other side might be down or service is not supported in the peer. App can retry later
+ @param  CONNECTION_FAILURE_PEERAGENT_REJECTED: The remote peer rejected the service connection. Peer has rejected, App can retry again
+ ****************************************************************************/
+typedef enum ServiceConnectionResponseCode {
+
+       CONNECTION_SUCCESS = 0, ///< Service Connection is successful. App can continue to send Data using sendData()
+       CONNECTION_ALREADY_EXIST, ///< Service Connection  already exists. Connection already exist use the same. If sendData fails again, create new connection
+       CONNECTION_FAILURE_DEVICE_UNREACHABLE, ///< Device is not reachable. It is not connected or connection is lost. Need to wait for connection again to retry
+       CONNECTION_FAILURE_INVALID_PEERAGENT, ///< The peer agent details (peer ID etc.) are invalid. Peer Agent is invalid, so do findPeerAgent() again and retry service connection
+       CONNECTION_FAILURE_NETWORK, ///< Connection failed due to network error. Try again. If error keeps happening, wait for connection and then retry.
+       CONNECTION_FAILURE_PEERAGENT_NO_RESPONSE, ///< The remote peer did not response to request. Since there is no response from peer, the other side might be down or service is not supported in the peer. App can retry later
+       CONNECTION_FAILURE_PEERAGENT_REJECTED ///< The remote peer rejected the service connection. Peer has rejected, App can retry again
+}ServiceConnectionResponseCode;
+
+
+/***************************************************************************//**
+ @brief  The enum defines the status codes returned when findPeerAgent is attempted.
+ @param  PEER_AGENT_FOUND: Peer agent found successfully. App can create service connection using createServiceConnection()
+ @param         PEER_AGENT_DEVICE_NOT_CONNECTED: When findPeerAgent was called, remote device was not connected. Wait for connection before retrying again
+ @param  PEER_AGENT_SERVICE_NOT_FOUND: ASP Id or service intended in findPeerAgent not found in remote device. Service not supported at other side. Chk valid Agent Id and retry again
+ @param  PEER_AGENT_FIND_TIMEDOUT: Request timed out without any response from the peer device. Retry again, it will succeed if service comes up at other side
+ @param  PEER_AGENT_FIND_END: Search for peer agent completed or some internal error. Recheck passed parameters and retry
+ ****************************************************************************/
+typedef enum FindPeerAgentResponseCode {
+
+       PEER_AGENT_FOUND = 0, ///< Peer agent found successfully. App can create service connection using createServiceConnection()
+       PEER_AGENT_DEVICE_NOT_CONNECTED, ///< When findPeerAgent was called, remote device was not connected. Wait for connection before retrying again
+       PEER_AGENT_SERVICE_NOT_FOUND, ///< ASP Id or service intended in findPeerAgent not found in remote device. Service not supported at other side. Chk valid Agent Id and retry again
+       PEER_AGENT_FIND_TIMEDOUT, ///< Request timed out without any response from the peer device. Retry again, it will succeed if service comes up at other side
+       PEER_AGENT_FIND_END ///< Search for peer agent completed or some internal error. Recheck passed parameters and retry
+}FindPeerAgentResponseCode;
+
+/***************************************************************************//**
+ @brief  The enum defines the error codes that shall be sent with onError callback, called when error occurs in an already established service connection.
+ @param  CONNECTION_LOST_PEER_DISCONNECTED : Connection loss due to Peer device disconnected. Based on App logic retry can be done with createServiceConnection()
+ @param         CONNECTION_LOST_DEVICE_DETACHED : Connection loss due to Peer device lost. Wait for new connection again to retry
+ @param  CONNECTION_LOST_UNKNOWN_REASON : Connection loss due to unknown reason. Mostly development error, app can retry
+ @remarks Error during the establishment of service connection shall be conveyed as response of service connection. onError shall not be called.
+ ****************************************************************************/
+typedef enum ServiceConnectionErrorCode {
+
+       CONNECTION_LOST_PEER_DISCONNECTED = 0, ///< Connection loss due to Peer device disconnected. Based on App logic retry can be done with createServiceConnection()
+       CONNECTION_LOST_DEVICE_DETACHED, ///< Connection loss due to Peer device lost. Wait for new connection again to retry
+       CONNECTION_LOST_UNKNOWN_REASON ///< Connection loss due to unknown reason. Mostly development error, app can retry
+}ServiceConnectionErrorCode;
+
+
+/***************************************************************************//**
+ @brief  The enum defines the reponse codes that shall be sent with FDefOnRegisterServiceAgentConfirm callback.
+ @param REGISTER_SUCCESS: registration is success
+ @param  DUPLICATE_REGISTRATION : App calls registerServiceAgent with same ASP ID again
+ @param         INVALID_ARGUMENTS : Invalid arguments, like ASP ID NULL etc. Apps should check the  input params & retry
+ @param  INTERNAL_ERROR : Any other internal error. App can retry registration.
+ @remarks Each app can register multiple ASP ID, but they should be different
+ ****************************************************************************/
+typedef enum RegisterAgentResponseCode {
+       REGISTER_SUCCESS = 0,
+       DUPLICATE_REGISTRATION,
+       INVALID_IN_ARGUMENTS,
+       INTERNAL_SAP_ERROR
+}RegisterAgentResponseCode;
+
+
+/***************************************************************************//**
+ @brief  The enum defines the status of data transfer operation
+ @param  DATA_SUCCESS: Data is sent successfully. App can continue to sendData() again
+ @param         INVALID_ARGUMENTS: Invalid arguments, like improper channel id etc. app need to recheck the passed param and retry
+ @param  INVALID_SERVICE_CONNECTION: The service connection indicated by the service handle does not exists. So creater service createServiceConnection() and retry
+ @param  NETWORK_FAILURE: Data transfer failed because of network error. Retry again
+ @param  BUFFER_FULL: Send buffer full.On receiving this application should wait for FDefOnSpaceAvailable before sending further data.
+ @param  SDK_ERROR: Any other internal sdk error. App should recheck the params passed and retry
+ ****************************************************************************/
+typedef enum DataTransferResultCode {
+
+       DATA_SUCCESS = 0, ///< Data is sent successfully. App can continue to sendData() again
+       INVALID_ARGUMENTS, ///< Invalid arguments, like improper channel id etc. app need to recheck the passed param and retry
+       INVALID_SERVICE_CONNECTION, ///< The service connection indicated by the service handle does not exists. So creater service createServiceConnection() and retry
+       NETWORK_FAILURE, ///< The service connection indicated by the service handle does not exists. So creater service createServiceConnection() and retry
+       BUFFER_FULL, ///< Send buffer full.On receiving this application should wait for FDefOnSpaceAvailable before sending further data.
+       SDK_ERROR ///< Any other internal sdk error. App should recheck the params passed and retry
+}DataTransferResultCode;
+
+
+/***************************************************************************//**
+ @brief  The enum defines the various connectivity types
+ @param  SAP_BT: BT connectivity
+ @param         SAP_BLE: BLE connectivity
+ @param  SAP_TCP: TCP connectivity
+ @param  SAP_USB: USB connectivity
+ ****************************************************************************/
+typedef enum ConnectivityType {
+
+       SAP_ALL =0, ///< All connectivity
+       SAP_BT=4 , ///< BT connectivity
+       SAP_BLE=8, ///< BLE connectivity
+       SAP_TCP_IP=16, ///< TCP connectivity
+       SAP_USB=32, ///< USB connectivity
+       SAP_CONNECTIVITY_END = 0xFF ///< End of Connectivity
+}ConnectivityType;
+
+
+/***************************************************************************//**
+ @brief  The enum defines the status codes that may be used to convey generic states as needed for SAP interaction.
+ @param  RESULT_TIMEOUT: When a request has timeout.
+ @param         RESULT_FAILURE: On failure of a request.
+ @param  RESULT_SUCCESS: On successfull execution of the request.
+ @param  RESULT_INPROGRESS: Progressive status of SAP to indicate reason for temporary failure.
+ ****************************************************************************/
+typedef enum{
+
+    RESULT_TIMEOUT = -2,
+    RESULT_FAILURE =-1,
+    RESULT_SUCCESS =0,
+    RESULT_INPROGRESS = 1
+}SAP_RESULT_VAL;
+
+
+/***************************************************************************//**
+ @brief  The enum defines the various Payload types
+ @param  SAP_NONE: None
+ @param         SAP_BINARY: Binary Payload
+ @param  SAP_JSON: JSON Payload
+ @param  SAP_ALL_PAYLOAD: Other PayloadTypes
+ ****************************************************************************/
+typedef enum PayloadType {
+
+       SAP_NONE = 0x00,
+       SAP_BINARY = 0x01, //BINARY Payloadtype supported
+       SAP_JSON = 0x02, //JSON PayloadType supported
+       SAP_ALL_PAYLOAD = 0xFF // Any other payloadType
+}PayloadType;
+
+typedef enum ErrorCode {
+
+       UNKNOWN_REASON = 0x00,///<Reason Unknown
+       SAP_ERROR_IPC_DISCONNECTED = 0x01,
+}SAPErrorCode;
+
+
+/***************************************************************************//**
+ @brief  The enum defines the Qos Priority value as required by service profile
+ @param  PRIORITY_LOW: Low Channel priority
+ @param         PRIORITY_MEDIUM: Medium Channel priority
+ @param  PRIORITY_HIGH: High channel priority is generally not preferred
+ ****************************************************************************/
+typedef enum Priority {
+
+       PRIORITY_LOW = 0X00, //Low priority
+       PRIORITY_MEDIUM,         //Medium priority
+       PRIORITY_HIGH            //High priority
+}SAPPriority;
+
+
+/*****************************************************************************
+ @brief  The enum defines the QOS-Arrival data rate values
+ @param  DATARATE_LOW: Low data rate
+ @param         DATARATE_HIGH: High data rate
+ ****************************************************************************/
+typedef enum DataRate {
+
+       DATARATE_LOW = 0X00, //Low data rate
+       DATARATE_HIGH //High data rate
+}SAPDataRate;
+
+
+/*****************************************************************************
+ @brief  The enum indicates the type of QoS support being requested
+ @param  UNRESTRICTED_INORDER: Unrestricted SDU and In-Order Delivery
+ @param         UNRESTRICTED_UNORDER: Unrestricted SDU and Unordered Delivery
+ @param  RESTRICTED_INORDER: Restricted SDU and In-Order Delivery
+ @param  RESTRICTED_UNORDER: Restricted SDU and Unordered Delivery
+ @param  RELIABLITY_DISABLE: Retransmission disabled
+ @param  RELIABILITY_ENABLE: Retransmission enabled
+ ****************************************************************************/
+typedef enum QosType {
+
+       UNRESTRICTED_INORDER = 0X00, //Unrestricted SDU and In-Order Delivery
+       UNRESTRICTED_UNORDER = 0X01, //Unrestricted SDU and Unordered Delivery
+       RESTRICTED_INORDER = 0X02, //Restricted SDU and In-Order Delivery
+       RESTRICTED_UNORDER = 0X03, //Restricted SDU and Unordered Delivery
+       RELIABLITY_DISABLE = 0X04, //Retransmission disabled
+       RELIABILITY_ENABLE = 0X05 //Retransmission enabled
+}SAPQosType;
+
+
+/*****************************************************************************
+ @brief  The enum defines the limit of connections restricted to a serivce agent
+ @param  SERVICE_LIMIT_ANY: No restrictions
+ @param         SERVICE_LIMIT_ONE_ACCESSORY: Can connect to multiple profiles in one Accessory
+ @param  SERVICE_LIMIT_ONE_PEERAGENT: Can connect to a single profile in multiple accessories
+ ****************************************************************************/
+typedef enum ServiceLimit{
+
+       SERVICE_LIMIT_ANY = 0X00, //Default
+       SERVICE_LIMIT_ONE_ACCESSORY, //Can connect to multiple profiles in one Accessory
+       SERVICE_LIMIT_ONE_PEERAGENT //Can connect to a single profile in multiple accessories
+}SAPServiceLimit;
+
+
+/***************************************************************************//**
+ @brief  The structure tagQoSObject stores the details of Qos parameters associated with a channel
+ @param  ubType: indicates the type of QoS support being requested
+ @param  ubPriority: defines the Qos Priority value as required by service profile
+ @param  ubDataRate: defines the QOS-Arrival data rate values
+ ****************************************************************************/
+typedef struct tagQoSObject{
+
+       SAPQosType ubType; //Type of Qos support
+       SAPPriority ubPriority; //Priority of the messages on the new session
+       SAPDataRate ubDataRate; //Rate at which data is sent
+}QoSObj;
+
+
+/***************************************************************************//**
+ @brief  The structure  tagChannelDesc is used to store the details associated with a channel
+ @param  wChannelID: channel identifier.
+ @param  ubNoOfPayloadType: No of payload type as listed in payloadTypeList.
+ @param  payloadTypeList: Payload type supported (0 for JSON, 1 for Binary).
+ @param  Qos: Qos requested from App
+ ****************************************************************************/
+typedef struct tagChannelDesc{
+
+       unsigned short int wChannelID;  ///< Channel identifier
+       unsigned short int ubNoOfPayloadType; ///< No of payload type as listed in payloadTypeList.
+       PayloadType payloadTypeList; ///< List of payload types supported (0 for JSON, 1 for Binary)
+       QoSObj Qos; ///< QoS requested from App
+}ChannelDesc;
+
+
+/***************************************************************************//**
+ @brief  The structure  tagServiceDesc is used to store the details associated with a specific service
+ @param  pchASPID: ASP Identifier that uniquely represent a profile.
+ @param  pchSPFName: Friendly name for the ASP ID.
+ @param  wConnectionTypeMask: Connectivity types that application is interested to support upon as per ConnectivityType.
+ @param  ubRole: specifies if the application shall be a consumer (1) or provider(0).The role should be opposite for the 2 peers for a profile
+ @param  pChDescArray : List of channels associated in the Service description.
+ @param  numChannels : number of channels listed in pChDescList.
+ @param  ubServiceLimit : Restricting the service connection based on App need
+ @param  uwSvcWaitTime : Timeout value for Service connection establishment
+ ****************************************************************************/
+typedef struct tagServiceDesc{
+
+       char* pchASPID; ///< ASP Identifier that uniquely represent a profile.
+       char* pchSPFName; ///< Friendly name for the ASP ID.
+       int  wConnectionTypeMask; ///< Connectivity types that application is interested to support upon as per ConnectivityType.
+       unsigned char ubRole; ///< specifies if the application shall be a consumer (1) or provider(0). The role should be opposite for the 2 peers for a profile
+       ChannelDesc *pChDescArray; ///< Array of channels associated in the Service description.
+       short int numChannels; ///< number of channels listed in pChDescList.
+       SAPServiceLimit ubServiceLimit; ///< Restricting the service connection based on App need
+       unsigned short int uwSvcWaitTime; ///< Timeout value for Service connection establishment in seconds
+}ServiceDesc;
+
+
+/***************************************************************************//**
+ @brief  The structure  tagPeerAgent is used to store the Peer agent details associated with a service profile ID
+ @param  udwPeerDeviceID: Peer device ID
+ @param  udwPeerAgentId: Peer agent running the service
+ @param  pchPeerDeviceName: Peer Device Name
+ @param  pchMACAddress: MAC Address
+ @param  pchALEName: ALE Name
+ @param  pchASPID: ASP ID supported
+ @param  pchProfileVersion: ASP version
+ @param  uwSvcWaitTime : Timeout value for Service connection establishment
+ ****************************************************************************/
+typedef struct tagPeerAgent {
+
+       unsigned int udwPeerDeviceID; ///< Peer device ID
+       unsigned int udwPeerAgentId; ///< Peer agent running the service
+       char *pchPeerDeviceName; ///< Peer Device Name
+       char *pchMACAddress; ///< MAC Address
+       char *pchALEName; ///< ALE Name
+       char *pchASPID; ///< ASP ID supported
+       char *pchProfileVersion; ///< ASP version
+       unsigned short int uwSvcWaitTime; ///< Timeout value for Service connection establishment
+}PeerAgent;
+
+
+/**************************************************************************//**
+  @brief To check the status of SAP connection
+  @returns : Returns integer value for sap connected status (Connected:1, Disconnected:0, Error:-1)
+* ************************************************************************** */
+int isSapConnected(void);
+
+/**************************************************************************//**
+@brief This function is called by the application to get the agent id assigned for its service profiles
+@param pchASPID [in] : Profile id of the service
+@param role [in]  : Role (provider/consumer)
+@returns Returns SAP_RESULT_VAL with RESULT_SUCCESS if get agent id request initiated successfully
+@remarks registerNotifications() needs to be called prior to calling this API. It needs to be called from App context
+                The Agent Id will be returned to the application in the registerServiceAgentConfirm() callback
+* ************************************************************************** */
+SAP_RESULT_VAL getRegisteredServiceAgent(char* pchASPID, ServiceAgentRole role);
+
+/**************************************************************************//**
+@brief This function is called by the application for initialization operations. This will register the service id and links with corresponding agent Id .Result of this operation will be informed using FDefOnRegisterServiceAgentConfirm() callback.
+@param pRegServiceRequest [in]   : Service Registration of the provider/consumer
+@returns Returns SAP_RESULT_VAL with RESULT_SUCCESS in case of successfully intiated registration or appropriate failure error if any error as per the SAP_RESULT_VAL ENUM.
+@remarks registerNotifications() needs to be called prior to calling this API. It needs to be called from App context
+* ************************************************************************** */
+ SAP_RESULT_VAL registerServiceAgent(ServiceDesc *pRegServiceRequest);
+
+/**************************************************************************//**
+ @brief This callback function gets triggered after registration of service agent registerServiceAgent() is completed .
+ @param wStatusCode [in]   : int shall be returned with RESULT_SUCCESS in case of success and appropriate error code in case of failure.
+ @param uwLocalAgentId [in]: LocalAgentId is unique identifier of the application represented to the SAP framework locally. It needs to be used in API as needed.
+**************************************************************************** */
+typedef  void (*FDefOnRegisterServiceAgentConfirm) (int wStatusCode, unsigned int uwLocalAgentId);
+
+/**************************************************************************//**
+@brief  This will de-register the service from the SAP framework. Result of this operation will be informed using FDefOnDeregisterServiceAgentConfirm() callback.
+@param uwLocalAgentId [in]: LocalAgentId is unique identifier of the application represented to the SAP framework locally, which was returned as part of FDefOnRegisterServiceAgentComplete.
+@returns  returns SAP_RESULT_VAL with RESULT_SUCCESS in case of successfully intiated deregistration or appropriate failure error if any error as per the SAP_RESULT_VAL ENUM.
+@remarks The API needs to be called from App context
+* ************************************************************************** */
+ SAP_RESULT_VAL  deRegisterServiceAgent(unsigned int uwLocalAgentId);
+
+/**************************************************************************//**
+ @brief This is the callback function.This function gets triggerd after deregister profile deRegisterServiceAgent() is completed
+ @param wStatusCode [in]   : SAP_RESULT_VAL shall be returned with RESULT_SUCCESS in case of success and appropriate error code in case of failure.
+ @param uwLocalAgentId [in]: LocalAgentId is unique identifier of the application represented to the SAP framework locally. It needs to be used in API as needed.
+ @returns  returns SAP_VOID.
+* ************************************************************************** */
+typedef  void (*FDefOnDeregisterServiceAgentConfirm) (int wStatusCode, unsigned int uwLocalAgentId);
+
+
+/**************************************************************************//**
+ @brief  The function findPeerAgent fetches handle to the associated PeerAgent as per ones own ASP ID as specified in ServiceDesc. uwLocalAgentId shall be indicate the same.
+ The user will get the handle to remote PeerAgent in callback FDefOnPeerAgent.
+ @param uwLocalAgentId [in]: LocalAgentId is unique identifier that was received when  FDefOnRegisterServiceAgentComplete callback was called.
+ @returns  returns SAP_RESULT_VAL with RESULT_SUCCESS in case of success or appropriate failure error if any error as per the SAP_RESULT_VAL ENUM.
+ @remarks The API needs to be called from App context
+ ****************************************************************************/
+SAP_RESULT_VAL findPeerAgent(unsigned int  uwLocalAgentId);
+
+
+/**************************************************************************//**
+ @brief This callback function gets triggered as a result of findPeerAgent() called by application.
+ @param  pPeerAgent [in] : The handle to the PeerAgent that has been discovered on call of findPeerAgent.
+ @param uwLocalAgentId [in]: LocalAgentId is unique identifier of the application represented to the SAP framework locally. Should be same as one received in FDefOnRegisterServiceAgentConfirm callback.
+ @param wStatusCode[in] : Status code indicating success or failure on call of findPeerAgent as per the FindPeerAgentResponseCode ENUM.
+ @returns : returns SAP_VOID.
+* ************************************************************************** */
+typedef  void (*FDefOnPeerAgent) (unsigned int uwLocalAgentId, PeerAgent* pPeerAgent, int  wStatusCode);
+
+
+/**************************************************************************//**
+ @brief This callback function gets triggered when a matching Service Agent is registered in a connected peer.
+ @param  pPeerAgent [in] : The handle to the PeerAgent that has a new service agent.
+ @param uwLocalAgentId [in]: LocalAgentId is unique identifier of the application represented to the SAP framework locally. This should be same as one received in FDefOnRegisterServiceAgentConfirm callback.
+ @returns : returns SAP_VOID.
+ @remarks: Upon receiving the PEER_AGENT_AVAILABLE the App can initiate a service Connection , Upon receiving the PEER_AGENT UNAVAILABLE the App has to wait for the PEER_AVAILABLE.
+* ************************************************************************** */
+typedef  void (*FDefOnPeerAgentIndication) (unsigned int uwLocalAgentId, PeerAgent* pPeerAgent, PeerStatus peerStatus);
+
+
+/**************************************************************************//**
+ @brief  The function createServiceConnection establishes service connection with specified peer agent.The service connection success/failure is indicated via callback FDefOnServiceConnectionConfirm().
+ @param uwLocalAgentId [in]: LocalAgentId is unique identifier that was received in  FDefOnRegisterServiceAgentComplete callback.
+ @param pPeerAgent [in]:Peer Agent containing the Service Id, App Id and Device id received in FDefOnPeerAgent callback.
+ @returns Returns SAP_RESULT_VAL with RESULT_SUCCESS in case of success or appropriate failure error if any error as per the SAP_RESULT_VAL ENUM.
+ @remarks RESULT_SUCCESS indicates that request for service connection has been successfully initiated. The actual service connection creation success/failure is indicated in callback FDefOnServiceConnectionConfirm(). The API needs to be called from App context
+*************************************************************************** */
+SAP_RESULT_VAL createServiceConnection(unsigned int uwLocalAgentId, PeerAgent* pPeerAgent);
+
+
+/**************************************************************************//**
+ @brief This callback function will get triggered when a new incoming service connection request is received from a remote peer.
+ The application shall call the function acceptServiceConnection to accept or  rejectServiceConnection to reject the connection.
+ @param uwLocalAgentId [in]: LocalAgentId is unique identifier that conveys local identifier of the Agent for which which service connection indication was received.
+ @param uwServiceHandle [in]   : The handle for the service connection indicated.
+ @param pPeerAgent [in]:Peer Agent containing the Service Id, App Id and Device id.
+ @returns Returns SAP_VOID.
+*************************************************************************** */
+typedef  void (*FDefOnServiceConnectionIndication) (unsigned int uwLocalAgentId, unsigned int uwServiceHandle, PeerAgent* pPeerAgent);
+
+
+/**************************************************************************//**
+ @brief Accept an incoming service connection request. This is typically called from the registered callback FDefOnServiceConnectionIndication().
+ @param uwLocalAgentId [in]: LocalAgentId is unique identifier that may be used to convey the specific identifier of the localAgentId with which service connection request was received.
+ @param uwServiceHandle [in]   : The handle for the incoming service connection request.
+ @param pPeerAgent [in]:Peer Agent containing the Service Id, App Id and Device id
+ @returns Returns SAP_RESULT_VAL with RESULT_SUCCESS in case of success or appropriate failure error if any error as per the SAP_RESULT_VAL ENUM.
+ @remarks The API needs to be called from App context
+**************************************************************************** */
+SAP_RESULT_VAL acceptServiceConnection(unsigned int uwLocalAgentId, unsigned int uwServiceHandle, PeerAgent* pPeerAgent);
+
+
+/**************************************************************************//**
+ @brief Reject an incoming service connection request. This is typically called from the registered callback FDefOnServiceConnectionIndication().
+ @param uwLocalAgentId [in]: LocalAgentId is unique identifier that may be used to convey the specific identifier of the localAgentId with which service connection request was received.
+ @param uwServiceHandle [in]   : The handle for the incoming service connection request.
+ @param pPeerAgent [in]:Peer Agent containing the Service Id, App Id and Device id
+ @returns : Returns SAP_RESULT_VAL with RESULT_SUCCESS in case of success or appropriate failure error if any error as per the SAP_RESULT_VAL ENUM.
+ @remarks The API needs to be called from App context
+* ************************************************************************** */
+
+SAP_RESULT_VAL rejectServiceConnection(unsigned int uwLocalAgentId, unsigned int uwServiceHandle, PeerAgent* pPeerAgent);
+
+
+/**************************************************************************//**
+ @brief This callback function gets triggerd to notify the success or failure of service connection request initiated by the application. Will be sent only to the initiator of the connection.
+ @param uwLocalAgentId [in]: LocalAgentId is unique identifier that may be used to convey the specific identifier of the localAgentId with which service connection was established.
+ @param uwServiceHandle [in]   : The handle for the service connection.
+ @param pPeerAgent [in]:Peer Agent containing the Service Id, App Id and Device id
+ @param wResponseCode [in]: status code:  Status code value is one of the ServiceConnectionResponseCode enum.
+ @returns Returns SAP_VOID.
+* ************************************************************************** */
+typedef void (*FDefOnServiceConnectionConfirm) (unsigned int uwLocalAgentId, unsigned int uwServiceHandle,  PeerAgent* pPeerAgent, int wResponseCode);
+
+
+/**************************************************************************//**
+ @brief Send data over a service connection. If send fails with BUFFER_FULL app should wait for FDefOnSpaceAvailable() callback
+ @param uwServiceHandle [in]   : The handle for the service connection.
+ @param ubChannelId [in] : The channel id on which data has to be sent
+ @param uwPayloadLength [in]  : The length of payload data..
+ @param pvBuffer [in]: The data buffer to be sent
+ @returns  Returns one of the status codes in DataTransferResultCode ENUM.
+ @remarks Max 65528 bytes can be sent . sendData should not be called in SAP callback and sendData should not be called simulataneous from different threads.
+* ************************************************************************** */
+DataTransferResultCode sendData(unsigned int uwServiceHandle, unsigned short int ubChannelId, unsigned int uwPayloadLength,void *pvBuffer);
+
+
+/**************************************************************************//**
+ @brief Send Secure data over a service connection. If send fails with BUFFER_FULL app should wait for FDefOnSpaceAvailable() callback
+ @param uwServiceHandle [in]   : The handle for the service connection.
+ @param ubChannelId [in] : The channel id on which data has to be sent
+ @param uwPayloadLength [in]  : The length of payload data..
+ @param pvBuffer [in]: The data buffer to be sent
+ @returns  Returns one of the status codes in DataTransferResultCode ENUM.
+ @remarks Max 65528 bytes can be sent . sendSecureData should not be called in SAP callback and sendSecureData should not be called simulataneous from different threads.
+* ************************************************************************** */
+DataTransferResultCode sendSecureData(unsigned int uwServiceHandle, unsigned short int ubChannelId, unsigned int uwPayloadLength,void *pvBuffer);
+
+
+/**************************************************************************//**
+ @brief This callback function gets triggered when the application receives data from an active service connection.
+ @param uwServiceHandle [in]   : The handle for the service connection on which data has been received.
+ @param  ubChannelId [in] : The channel id on which data has been received
+ @param uwPayloadLength [in]  : The length of payload data.
+ @param pvBuffer [in]: The data buffer that has been received
+ @returns Returns SAP_VOID.
+* ************************************************************************** */
+typedef  void (*FDefOnReceive) (unsigned int uwServiceHandle, unsigned short int uwChannelId, unsigned int uwPayloadLength, void *pvBuffer);
+
+
+/**************************************************************************//**
+@brief  Terminate service connection corresponding to given service handle.
+@param uwServiceHandle [in] : The handle of the service Connection. The same handle returned in FDefOnServiceConnectionConfirm() should be used.
+@returns Returns RESULT_SUCCESS if successfully intitated the request else appropriate failure error code as specified in SAP_RESULT_VAL ENUM.
+@remarks RESULT_SUCCESS indicates that request for terminate service connection has been succesfully processed. The Api needs to be called in App context
+* ************************************************************************** */
+SAP_RESULT_VAL terminateServiceConnection(unsigned int uwServiceHandle);
+
+
+/**************************************************************************//**
+ @brief This callback function will get triggered when a service connection is terminated as a result of a trigger from remote peer.
+ @param uwServiceHandle [in]   : The handle for the service connection.
+ @returns : returns SAP_VOID.
+* ************************************************************************* */
+typedef void (*FDefOnServiceTerminationIndication) (unsigned int uwServiceHandle,int wStatusCode);
+
+
+/**************************************************************************//**
+ @brief This callback function gets triggered when error occurs but was not relayed as part of a request-response transaction. Triggered also if the other side has called terminateServiceConnection()
+ @param uwServiceHandle [in]   : The handle for the service connection on which data has been received.
+ @param dwErrorCode [in]   : Error Code defined in SAPErrorCode Enum
+ @returns Returns SAP_VOID.
+* ************************************************************************** */
+typedef  void (*FDefOnError) (unsigned int uwServiceHandle, unsigned int dwErrorCode);
+
+
+/**************************************************************************//**
+ @brief This callback function gets triggerd when space is avilable for application to write. Application should wait for this callback if send returns failure with BUFFER_FULL
+ @param uwServiceHandle [in]   : The handle for the service connection on which data has been received.
+ @param uwChannelId [in] : The channel identifier on which the onSpaceAvailable callback is called.
+ @param  ulSpaceAvailable [in] : How much space is available in bytes
+ @returns Returns DataTransferResultCode.
+* ************************************************************************** */
+typedef  void (*FDefOnSpaceAvailable) (unsigned int uwServiceHandle, unsigned short int uwChannelId, unsigned int ulSpaceAvailable);
+
+/***************************************************************************//**
+ @brief  The structure  holds references to callback for application for various events from framework.
+ @param  pfnOnRegisterServiceAgentConfirm: Register Service Agent Confirmation function pointer
+ @param  pfnOnDataIndication: Data Indication function pointer
+ @param  FDefOnServiceConnectionIndication: Service connection indication function pointer
+ @param  pfnOnServiceTerminationIndication: Service termination indication function pointer
+ @param  pfnOnServiceCreateConfirm: Service create confirm function pointer
+ @param  pfnOnPeerAgent: Peer Agent availability function pointer
+ @param  pfnOnSpaceAvailable: Space available for send function pointer
+ @param  pfnOnError: Error function pointer
+ @param  pfnOnDeRegisterServiceAgentConfirm: DeRegister service Agent function pointer
+ ****************************************************************************/
+typedef  void (*FDefOnDeviceStatus) (ConnectivityType device_type, enum device_status status);
+
+typedef struct tagSAPNotification
+{
+       FDefOnRegisterServiceAgentConfirm pfnOnRegisterServiceAgentConfirm; ///< Register Service Agent Confirmation function pointer
+       FDefOnReceive pfnOnDataIndication; ///< Data Indication function pointer
+       FDefOnServiceConnectionIndication pfnOnServiceConnectionIndication; ///< Service connection indication function pointer
+       FDefOnServiceTerminationIndication pfnOnServiceTerminationIndication; ///< Service termination indication function pointer
+       FDefOnServiceConnectionConfirm pfnOnServiceCreateConfirm; ///< Service create confirm function pointer
+       FDefOnPeerAgent pfnOnPeerAgent; ///< Peer Agent availability function pointer
+       FDefOnSpaceAvailable pfnOnSpaceAvailable; ///< Space available for send function pointer
+       FDefOnError  pfnOnError; ///< Error function pointer
+       FDefOnDeregisterServiceAgentConfirm pfnOnDeRegisterServiceAgentConfirm; ///< DeRegister service Agent function pointer
+       FDefOnDeviceStatus pfnDeviceStatus;
+       FDefOnPeerAgentIndication pfnOnPeerAgentNoti; ///<  Peer Agent Notification
+}SAPNotification;
+
+
+ /**************************************************************************//**
+@brief This function registers all the callbacks in SAPNotification. This needs to be the first API that needs to be called from the App.
+@param notiFuncs [in]   : Notification functions which are to be registered for getting callback.
+@returns Returns SAP_RESULT_VAL with RESULT_SUCCESS in case of success and appropriate failure error if any error as per the SAP_RESULT_VAL ENUM.
+* ************************************************************************** */
+SAP_RESULT_VAL registerNotifications(SAPNotification notiFuncs);
+
+
+/**************************************************************************//**
+@brief This function deregisters all the callbacks in SAPNotification. This should be called when App get FDefOnError callback.
+@returns Returns SAP_RESULT_VAL with RESULT_SUCCESS in case of success and appropriate failure error if any error as per the SAP_RESULT_VAL ENUM.
+* ************************************************************************** */
+SAP_RESULT_VAL deregisterNotifications(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_SAPINTERFACE_H_ */
diff --git a/files/sap-api.pc b/files/sap-api.pc
new file mode 100644 (file)
index 0000000..47d4587
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: sap-api
+Description: SAMSUNG Linux platform SAP framework API
+Version: 1.0.0
+Requires:
+Libs: -L${libdir} -lsap-api
+Cflags: -I${includedir}
diff --git a/files/sap-client-stub-api.pc b/files/sap-client-stub-api.pc
new file mode 100644 (file)
index 0000000..81e2db5
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: sap-client-stub-api
+Description: SAMSUNG Linux platform SAP framework API
+Version: 1.0.0
+Requires:
+Libs: -L${libdir} -lsap-client-stub-api
+Cflags: -I${includedir}/sap-service
diff --git a/files/x86/bin/ft-service b/files/x86/bin/ft-service
new file mode 100755 (executable)
index 0000000..d0061d2
Binary files /dev/null and b/files/x86/bin/ft-service differ
diff --git a/files/x86/bin/sap-server b/files/x86/bin/sap-server
new file mode 100755 (executable)
index 0000000..2111a1b
Binary files /dev/null and b/files/x86/bin/sap-server differ
diff --git a/files/x86/lib/libsap-api.so b/files/x86/lib/libsap-api.so
new file mode 120000 (symlink)
index 0000000..f5066df
--- /dev/null
@@ -0,0 +1 @@
+libsap-api.so.1
\ No newline at end of file
diff --git a/files/x86/lib/libsap-api.so.1 b/files/x86/lib/libsap-api.so.1
new file mode 120000 (symlink)
index 0000000..2388d9a
--- /dev/null
@@ -0,0 +1 @@
+libsap-api.so.1.0.0
\ No newline at end of file
diff --git a/files/x86/lib/libsap-api.so.1.0.0 b/files/x86/lib/libsap-api.so.1.0.0
new file mode 100755 (executable)
index 0000000..5911d27
Binary files /dev/null and b/files/x86/lib/libsap-api.so.1.0.0 differ
diff --git a/files/x86/lib/libsap-client-stub-api.so b/files/x86/lib/libsap-client-stub-api.so
new file mode 120000 (symlink)
index 0000000..cfbb315
--- /dev/null
@@ -0,0 +1 @@
+libsap-client-stub-api.so.1
\ No newline at end of file
diff --git a/files/x86/lib/libsap-client-stub-api.so.1 b/files/x86/lib/libsap-client-stub-api.so.1
new file mode 120000 (symlink)
index 0000000..dc0dedd
--- /dev/null
@@ -0,0 +1 @@
+libsap-client-stub-api.so.1.0.0
\ No newline at end of file
diff --git a/files/x86/lib/libsap-client-stub-api.so.1.0.0 b/files/x86/lib/libsap-client-stub-api.so.1.0.0
new file mode 100755 (executable)
index 0000000..b905ccd
Binary files /dev/null and b/files/x86/lib/libsap-client-stub-api.so.1.0.0 differ
diff --git a/files/x86/lib/libwsm.so b/files/x86/lib/libwsm.so
new file mode 100644 (file)
index 0000000..9e1d6d4
Binary files /dev/null and b/files/x86/lib/libwsm.so differ
diff --git a/packaging/ft.service b/packaging/ft.service
new file mode 100644 (file)
index 0000000..7aef876
--- /dev/null
@@ -0,0 +1,9 @@
+[Unit]
+Description=File Transer Service with SAP
+After=sap.service
+Requires=sap.service
+
+[Service]
+ExecStart=/usr/bin/ft-service
+Restart=always
+RestartSec=0
diff --git a/packaging/sap.manifest b/packaging/sap.manifest
new file mode 100644 (file)
index 0000000..5650ae7
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest>
+       <define>
+       <domain name="sap"/>
+               <provide>
+                       <label name="sap::vconf"/>
+               </provide>
+               <request>
+                       <smack request="sap" type="w"/>
+                       <smack request="sap::vconf" type="rw"/>
+                       <smack request="bt-service::spp" type="rw"/>
+                       <smack request="deviced::display" type="rw"/>
+                       <smack request="system::media" type="rwat"/>
+                       <smack request="com.samsung.w-contacts2" type="rwat"/>
+                       <smack request="system::use_internet" type="rwx"/>
+               </request>
+               <permit>
+                       <smack permit="system::use_internet" type="rwx"/>
+               </permit>
+<!-- applications should append this rule to their SMACK definition
+               <request>
+                       <smack request="sap" type="w"/>
+                       <smack request="sap::vconf" type="rl"/>
+               </request>
+-->
+       </define>
+       <assign>
+               <filesystem path="/usr/lib/*" label="_"/>
+       </assign>
+       <request>
+               <domain name="sap"/>
+       </request>
+</manifest>
diff --git a/packaging/sap.service b/packaging/sap.service
new file mode 100644 (file)
index 0000000..aefc395
--- /dev/null
@@ -0,0 +1,16 @@
+[Unit]
+Description=SAP service
+After=deviced.service
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/sap-server
+ExecStopPost=/usr/bin/vconftool set -f -t int memory/private/sap/conn_status 0 -i -f -u 5000 -s system::vconf
+ExecStopPost=/usr/bin/vconftool set -f -t int memory/private/sap/rfcomm_ready 0 -i -f -u 5000 -s system::vconf
+ExecStopPost=/usr/bin/vconftool set -f -t bool memory/wms/wmanager_connected 0 -i -f -u 5000 -s system::vconf
+
+TimeoutStopSec=1s
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/sap.spec b/packaging/sap.spec
new file mode 100644 (file)
index 0000000..6eb95e8
--- /dev/null
@@ -0,0 +1,85 @@
+Name:       sap
+Summary:    APPCESSORY
+Version:    1.0.0
+Release:    0
+Group:      Network & Connectivity/Other
+License:    Samsung Proprietary
+Source0:    %{name}-%{version}.tar.gz
+Source1:       %{name}.manifest
+Source2:       %{name}.service
+Source3:       %{name}.target
+Source4:       ft.service
+BuildRequires: cmake
+Requires:      /usr/bin/vconftool
+Requires:      libstorage
+Requires:      /usr/bin/api_feature_loader
+%ifarch %arm
+%global ARM_DEF "-DARM_TARGET=Y"
+%endif
+
+provides: libsap-api.so.1 libsap-client-stub-api.so.1 libwsm.so
+
+%description
+APPCESSORY
+
+%package devel
+Summary:  APPCESSORY (devel)
+Group:    Network & Connectivity/Development
+Requires: %{name} = %{version}
+
+%description devel
+APPCESSORY (devel)
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+cp %{SOURCE2} .
+cp %{SOURCE3} .
+cp %{SOURCE4} .
+
+%build
+%cmake . %{?ARM_DEF} -DBIN_INSTALL_DIR:PATH=%{_bindir}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+mkdir -p %{buildroot}%{_libdir}/systemd/system/sap.target.wants
+mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
+cp -af %{SOURCE2} %{buildroot}%{_libdir}/systemd/system/
+cp -af %{SOURCE3} %{buildroot}%{_libdir}/systemd/system/
+cp -af %{SOURCE4} %{buildroot}%{_libdir}/systemd/system/
+ln -s %{_libdir}/systemd/system/sap.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
+ln -s %{_libdir}/systemd/system/ft.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
+
+%post
+/sbin/ldconfig
+vconftool set -tf int memory/private/sap/conn_status 0 -u 5000 -s system::vconf -i
+vconftool set -tf int memory/private/sap/rfcomm_ready 0 -u 5000 -s system::vconf -i
+
+api_feature_loader --verbose --dir=/usr/share/privilege-control/
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%manifest %{name}.manifest
+%attr(755,root,root) %{_bindir}/sap-server
+%attr(755,root,root) %{_bindir}/ft-service
+%{_bindir}/frameworkPolicyDelgate.xml
+%{_libdir}/libsap-client-stub-api.so.*
+%{_libdir}/libsap-api.so.*
+%{_libdir}/libwsm.so
+%{_libdir}/systemd/system/sap.service
+%{_libdir}/systemd/system/sap.target
+%{_libdir}/systemd/system/ft.service
+%{_libdir}/systemd/system/multi-user.target.wants/sap.service
+%{_libdir}/systemd/system/multi-user.target.wants/ft.service
+/usr/share/appcessory/file-transfer.xml
+/usr/share/privilege-control/*.smack
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/sap-service/*
+%{_libdir}/pkgconfig/*.pc
+%{_libdir}/*sap*.so
diff --git a/packaging/sap.target b/packaging/sap.target
new file mode 100644 (file)
index 0000000..4c90a74
--- /dev/null
@@ -0,0 +1,3 @@
+[Unit]
+Description=SAP
+StopWhenUnneeded=yes