Skip to content

203 Card Verification to Cloud ​

When the device detects an unregistered NFC card, it immediately transfers the information via Bluetooth to Hub3/APP.
Hub3/APP performs the verification, or forwards it to the cloud for verification.

Based on the verification result, Hub3/APP or the cloud sends a direct command to the lock linked with this SesameTouch to perform unlocking.

Sequence Diagram ​

ssm_touch Push Content ​

ByteN ~ 210
Datapayloaditem_codetype
DescriptionData to mobileCommand IDPush type

type : SSM2_OP_CODE_PUBLISH (0x08)

item code : SSM_OS3_VARIFY_CARD_TO_CLOUD (203)

payload : see the table below


Enumerations and Data Structure ​

c

typedef enum {
  CARD_TYPE_OTHER = 0x00,
  CARD_TYPE_SUICA = 0x01,
  CARD_TYPE_PASMO = 0x02,
} CARD_TYPE;

typedef struct {
    uint8_t card_header;  // EMPTY 0xFF, USED 0xF0, DELETED 0x00
    uint8_t card_type;  // MIFARE,FeliCa,etc.
    uint8_t card_id_lg;  // Length of card ID
    uint8_t card_id[16];
    uint8_t card_name_lg;  // Length of card ID
    uint8_t card_name[20];
} card_note_t;  /// total 40 bytes

Payload Format ​

The payload data structure for card addition is as follows:

Byte OffsetNameTypeDescription
0card_typeuint8Card type (see CARD_TYPE)
1id_lengthuint8Length of card ID (in bytes)
2 ~ (id_length + 1)card_iduint8[id_length]Card ID as byte array
id_length + 2name_lengthuint8Length of name (in bytes)
(id_length + 3) ~ (id_length + name_length + 2)card_nameuint8[name_length]UTF-8 encoded name byte array

Example Payload Bytes ​

Assuming card type is SUICA(0x01), ID is "12345678", and name is "Home":

Byte OffsetContent (Hex)Description
00x01CARD_TYPE_SUICA
10x08ID length = 8 bytes
2~90x01 02 03 04 05 06 07 08"12345678"
100x04Name length = 4 bytes
11~140x48 6F 6D 65"Home"

Device Response Format (from Hub3) ​

Byte Offset210
DataresCommand codeResponse type
DescriptionCommand resultCurrent command identifierResponse type constant
  • type : SSM2_OP_CODE_RESPONSE(0x07)
  • item code : SSM_OS3_VARIFY_CARD_TO_CLOUD(203)
  • res:CMD_RESULT_SUCCESS(0x00)or failure status code

iOS、Android、ESP32 Example ​

Android Example ​

kotlin
TODO()

esp32 Example ​

c
// todo

iOS Example ​

swift
TODO()