SendCancelCommand
The POS device calls the SendCancelCommand API to send a command to the BlueTap device to disable the NFC link.
Method signature
/**
* Send cancel command to the BlueTap device
*/
ResultCode SendCancelCommand(CancelCommand cancelCommand);Request parameter
Item | Type | Description | Required |
cancelCommand | The command sent to the BlueTap device to disable the NFC link. | M |
CancelCommand
Item | Type | Length | Description | Required |
OrderId | String | 16 | The order ID created by the POS device to identify an order. | O |
Response parameter
Item | Type | Description | Required |
/ | The result code that indicates the result of the command sending. For more information about the result code, see the ResultCode section. | M |
ResultCode
ResultCode | Description |
| Success. |
| The BlueTap device is disconnected. |
| The parameter values are invalid. |
| Failed to send the command. |
| System exception. |
Sample
C#
This following sample shows how to use the SendCancelCommand API in C#.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;
using BluetapLib;
namespace BluetapTest
{
static class Program
{
private static void Main(string[] args)
{
TinyCommand tinyCommand = new TinyCommand();
/* Send CancelCommand */
CancelCommand cancelCommand = new CancelCommand();
result = tinyCommand.SendCancelCommand(cancelCommand);
}
}
}Python
This following sample shows how to use the SendCancelCommand API in Python.
import hid
import bluetaplib
tinyCommand = bluetaplib.TinyCommand()
cancelCommand = bluetaplib.CancelCommand()
tinyCommand.SendCancelCommand(cancelCommand)Note: Contact your Alipay+ Solution Architect to obtain the
BluetapLib.dllfile.
Python code requires hid and bluetaplib to execute. Use the command below in terminal to install them.
pip install hidapi
pip install bluetaplib-1.0.0-py3-none-any.whlNote: Contact your Alipay+ Solution Architect to obtain the
bluetaplib-x.x.x-py3-none-any.whlfile.