Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • AnW_STA5_SmartLink AnW_STA5_SmartLink
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • Ervin Lan
  • AnW_STA5_SmartLinkAnW_STA5_SmartLink
  • Wiki
  • STA5 SmartLink command guidance

Last edited by delly chen Mar 22, 2023
Page history
This is an old version of this page. You can view the most recent version or browse the history.

STA5 SmartLink command guidance

STA5 SmartLink command guidance

Requirement

  • Platform: STA5

  • The version can be found in sml_def.h, please follow the latest version.

  • Please import below files to your project, they’re under SmartLink build folder:

export
  ├── include
  │   ├── libunixsocket.h
  │   ├── sml_def.h  
  │   └── sml_data_format.h  
  └── libsocket.so

APIs

  • To connect:
ret = sfd = create_unix_stream_socket(TMP_SOCKET_SML, 0);
if (ret < 0) {
    perror(0);
    exit(1);
}
  • Send message:
ret = write(sfd, &send_data, sizeof(send_data));
if (ret < 0) {
    perror(0);
    goto ERR_EXIT;
}
  • Receive message:
ret = bytes = read(sfd, buf, MAX_MESSAGE_READ);
if (ret < 0) {
    perror(0);
    exit(1);
}

SmartLink data format

Data member Date type Data length Description
version unsigned char 1 byte Set to SML_MAJOR_VERSION.
mode unsigned char 1 byte Refer to type REQ_MODE.
AppType unsigned char 1 byte Refer to type APP_TYPE.
state unsigned char 1 byte Refer to type SML_STATE_CODE.
AppClientID unsigned int 4 bytes Client ID.
srcAppName unsigned char[128] 128 bytes Source application name in string.
dstAppName unsigned char[128] 128 bytes Destination application name in string.
cmd unsigned int 4 bytes Refer to type SML_COMMAND.
len unsigned int 4 bytes Total length of message in bytes.
Clone repository
  • APIs
  • STA5 SmartLink command guidance
  • Home