Difference between revisions of "EIS Service SDK"

From ESS-WIKI
Jump to: navigation, search
Line 50: Line 50:
 
<pre>/*
 
<pre>/*
 
*=============================================================================
 
*=============================================================================
*Function name: SV_Initialize
+
* Function name: SV_Initialize
* &nbsp;Description: Initialize the Service SDK
+
* Description: Initialize the Service SDK
* &nbsp;Parameter:
+
* Parameter:
&nbsp;* &nbsp; &nbsp; &nbsp;- Service_Cb &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fn: &nbsp;point of callback function
+
*         - Service_Cb     fn: point of callback function
* &nbsp; &nbsp; &nbsp; - void* &nbsp; pInUserData: &nbsp;user data will pass when callback
+
*         - void* pInUserData: user data will pass when callback
&nbsp;*
+
*
&nbsp;* &nbsp;Return value:
+
* Return value:
&nbsp;* &nbsp; &nbsp; &nbsp; SV_CODE &nbsp; &nbsp;- SV_OK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: &nbsp;Successful&nbsp;
+
* SV_CODE - SV_OK       : Successful
&nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - SV_ER_FAILED &nbsp;: &nbsp;Failed to call
+
*         - SV_ER_FAILED : Failed to call
&nbsp;*
+
*
&nbsp;* &nbsp;History:
+
* History:   06/26/2017 Modified
&nbsp;* &nbsp; &nbsp; &nbsp; Eric Liang &nbsp; &nbsp; &nbsp;06/26/2017 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Modified
+
* =============================================================================
&nbsp;* =============================================================================
+
*/</pre>
&nbsp;*/
+
 
'''SV_CODE SV_Initialize'''( Service_Cb fn, void *pInUserData )</pre>
+
<br/>'''​SV_CODE SV_Initialize'''( Service_Cb fn, void *pInUserData )
  
  

Revision as of 04:11, 3 July 2017

Definition

Service Return Code

typedef enum {                                                        
    SV_ER_NOT_IMPLEMENT                = -13,   /*        Does Not Support this command        (501)        */
    SV_ER_TIMEOUT                      = -12,   /*        Request Timeout                      (408)        */
    SV_ER_SYS_BUSY                     = -11,   /*        System is busy                       (503)        */
    SV_ER_VALUE_OUT_OF_RNAGE           = -10,   /*        Value is out of range                (416)        */
    SV_ER_SYNTAX_ERROR                 =  -9,   /*        Format is correct but syntax error   (422)        */
    SV_ER_FORMAT_ERROR                 =  -8,   /*        Format error                         (415)        */
    SV_ER_REQUEST_ERROR                =  -7,   /*        Request error                        (400)        */
    SV_ER_RESOURCE_LOSE                =  -6,   /*        SenHub disconnect                    (410)        */
    SV_ER_RESOURCE_LOCKED              =  -5,   /*        Resource is in setting               (426)        */
    SV_ER_NOT_FOUND                    =  -4,   /*        Resource Not Found                   (404)        */
    SV_ER_WRITE_ONLY                   =  -3,   /*        Read Only                            (405)        */
    SV_ER_READ_ONLY                    =  -2,   /*        Write Only                           (405)        */
    SV_ER_FAILED                       =  -1,   /*        Failed                               (500)        */
    SV_OK                              =   0,   /*        Success                              (200)        */
    SV_INITILIZED                      =   1,   /*        Library had initilized                            */
} SV_CODE;

Service Status

typedef enum
{
    SV_UNINIT = 0,
    SV_INIT   = 1,
    SV_JOINED = 2,
    SV_LEAVED = 3,
}SV_STATUS;

Service Event Callback Function

typedef SV_CODE (SVCALL *Service_Cb) ( SV_EVENT e, char *ServiceName, void *inData, int dataLen, void *UserData )

Service Event Type

typedef enum
{
    SV_E_JoinServiceSystem,        // Connected to the Service System
    SV_E_LeaveServiceSystem,       // Disconnected from the Service System
    SV_E_RegisterService,          // Registed a new Service ( ex: HDD_PMQ Plugin )
    SV_E_DeregisterService,        // Deregisted a Service
    SV_E_UpdateServiceCapability,  // Update Service's Capability
    SV_E_UpdateData,               // Update Service's data value
    SV_E_ActionResult,             // Get / Set Reply
    SV_E_EventNotify,              // EventNotify
}SV_EVENT;

Functions

Initial & Uninitial 

/*
*=============================================================================
* Function name: SV_Initialize
* Description: Initialize the Service SDK
* Parameter:
*         - Service_Cb     fn: point of callback function
*         - void* pInUserData: user data will pass when callback
*
* Return value:
* SV_CODE  - SV_OK        : Successful
*          - SV_ER_FAILED : Failed to call
*
* History:   06/26/2017 Modified
* =============================================================================
*/


​SV_CODE SV_Initialize( Service_Cb fn, void *pInUserData )


SV_CODE SV_Uninitialize( );  

Function Information

SV_CODE SV_GetVersion(char *outVersion, int bufSize ); 

SV_STATUS SV_GetServiceStatus( );

SV_CODE SV_Query_Service( char *outBuf, int bufSize );

SV_CODE SV_GetCapability( const char *ServiceName, char *outBuffer,  int bufSize )

SV_CODE SV_AutoReportStart( const char *ServiceName , char *inData, int inDataLen  );

SV_CODE  SV_AutoReportStop( const char *ServiceName, char *inData, int inDataLen );

SV_CODE SV_Action( const char *ServiceName , char *szAction,  void *pUserData );