Difference between revisions of "EIS Service SDK"

From ESS-WIKI
Jump to: navigation, search
Line 24: Line 24:
 
{
 
{
 
     SV_LEAVED    = -1,
 
     SV_LEAVED    = -1,
     SV_INIT      = 0,
+
     SV_INIT      = 0,
 
     SV_JOINED    =  1,
 
     SV_JOINED    =  1,
 
}SV_STATUS;</pre>
 
}SV_STATUS;</pre>

Revision as of 07:27, 23 June 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_LEAVED    = -1,
    SV_INIT      =  0,
    SV_JOINED    =  1,
}SV_STATUS;

Service Event Callback Function

typedef int 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;

Service API

SV_CODE SV_Initialize(void *pInUserData);  

SV_CODE SV_Uninitialize(void *pInParam);  

SV_CODE SV_SetCallback( Service_Cb fn );

SV_CODE SV_GetVersion(char *psVersion, int BufLen); 

SV_STATUS SV_GetStatus_Service( );

SV_CODE SV_Query_Service( char *buffer, int bufsize );

SV_CODE SV_GetCapability( const char *ServiceName, char *outBuffer,  int BufferLen );

SV_CODE SV_AutoReportStart( const char *ServiceName , const char *pInQuery );

SV_CODE  SV_AutoReportStop( const char *ServiceName );

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