Inventory Mode Configuration


⚠️ Note: This document describes how to use the SDK's API to operate the scanning device and provides sample code in C language. Please note that the API is a synchronous operation and may block the main thread when used.

⚠️ Note: Before using the API, you need to connect the device first. For specific steps, please refer to Connect Device.

⚠️ Note: Before using the API on this page, you need to connect the device with a USB cable.

1. Upload Cached Data

Upload the cached data of the scanning device. A USB cable is required to connect the device, and the data is uploaded to the wired terminal. The usage is as follows:

const char* result = inateck_scanner_ble_inventory_upload_cache(device_id);

The return result is in JSON format. If the call is successful, result will return:

{
    "status": 0,
    "error": "",
}

If the call fails, result will return:

{
    "status": 1,
    "error": "error message",
}

2. Upload Cached Count

Upload the cached count of the scanning device. A USB cable is required to connect the device, and the data is uploaded to the wired terminal. The usage is as follows:

const char* result = inateck_scanner_ble_inventory_upload_count(device_id);

The return result is in JSON format. If the call is successful, result will return:

{
    "status": 0,
    "error": "",
}

If the call fails, result will return:

{
    "status": 1,
    "error": "error message",
}

3. Clear Cached Data

Clear the cached data of the scanning device. The usage is as follows:

const char* result = inateck_scanner_ble_inventory_clear_cache(device_id);

The return result is in JSON format. If the call is successful, result will return:

{
    "status": 0,
    "error": "",
}

If the call fails, result will return:

{
    "status": 1,
    "error": "error message",
}

4. Sample Code

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include "inateck_scanner_ble.h"

int main() {
    const char* device_id = "device id";
    // Upload cached data
    const char* result = inateck_scanner_ble_inventory_upload_cache(device_id);
    printf("result: %s\n", result);
    // Upload cached count
    result = inateck_scanner_ble_inventory_upload_count(device_id);
    printf("result: %s\n", result);
    // Clear cached data
    result = inateck_scanner_ble_inventory_clear_cache(device_id);
    printf("result: %s\n", result);
    return 0;
}

5. Sample Code in Other Languages