设置 i2of5 交错配置的长度

Set length for i2of5 interleaved configuration

我已经弄清楚如何使用 ScanAPI 启用 i2of5,但它似乎没有更新与 i2of5 条形码类型关联的长度参数的明确示例。

我使用以下内容 'enable' i2of5...

[self.ScanApi postSetSymbologyInfo:_deviceInfoToTrigger SymbologyId:kSktScanSymbologyStandard2of5 Status:YES Target:self Response:@selector(onSetSymbology:)];

我想将长度参数(L1)设置为10。使用文档信息指定可以传入的数组。我想知道的是API调用是用来做什么的把这个参数数组传入?

这是我尝试过的,将长度设置为 10 (0xA0):

unsigned char deviceCommand[] = { 0x09,0xC6,0x04,0x00,0xFF,0x16,0xA0,0x00,0x00 };
[self.ScanApi postGetDeviceSpecific:_deviceInfoToTrigger Command:deviceCommand Length:9 Target:self Response:@selector(onSetDeviceSpecific:)];

我可以使用 Socket Mobile 命令条码文档中的条码轻松配置它,但我想在 Android 和 iOS 的应用程序中自动执行此操作。现在在 iOS 工作(很明显)。

你们非常亲密。 Device Specific 是正确的 属性 配置长度

如果您按如下方式更改两行,它应该可以工作

// Leave the L2 parameter ID unchanged
// 10 is 0x0A not 0xA0
unsigned char deviceCommand[] = { 0x09, 0xC6, 0x04, 0x00, 0xFF, 0x16, 0x0A, 0x17, 0x00 };

// You need to set the device specific property, not get it
[self.ScanApi postSetDeviceSpecific:_deviceInfoToTrigger Command:deviceCommand Length:9 Target:self Response:@selector(onSetDeviceSpecific:)];

编辑

正如您正确指出的那样,postSetDeviceSpecific 不存在。您需要将以下内容添加到 ScanApiHelper.mm

的副本中
/**
 * postSetDeviceSpecific
 *
 * post a command specific to a certain type of scanner
 * The command is usually a series of bytes that are understandable only
 * by one particular type of scanner therefore the type of scanner must be
 * checked prior calling this method
 *
 * @param deviceInfo to send the command to
 * @param pCommand pointer to the bytes to send to the device
 * @param length of the command in bytes
 * @param target main object receiving the response
 * @param response selector invoked when the response is received
 */
-(void)postSetDeviceSpecific:(DeviceInfo*)deviceInfo Command:(unsigned char*)pCommand Length:(int) length Target:(id)target Response:(SEL) response{
    ISktScanObject*scanObj=[SktClassFactory createScanObject];
    [[scanObj Property]setID:kSktScanPropIdDeviceSpecific];
    [[scanObj Property]setType:kSktScanPropTypeArray];
    [[scanObj Property]setArray:pCommand Length:length];
    CommandContext* command=[[CommandContext alloc]initWithParam:FALSE
                                                         ScanObj:scanObj
                                                      ScanDevice:[deviceInfo getSktScanDevice]
                                                          Device:deviceInfo
                                                          Target:target
                                                        Response:response];

    [self addCommand:command];
#if __has_feature(objc_arc)
#else
    [command release];
#endif

}