我正在尝试在一个插件扫描仪上实现这个MC3300X。我能够得到条形码,但我的意图是使用这个扫描仪的RFID。我被建议改变createDataWedgeProfile以启用RFID插件,并修改createDataWedgeBroadcastReceiver以反映接收到的意图的格式。问题是,我无法在斑马网站上找到任何与RFID相关的示例代码,所以我不确定使用什么解码模式。我尝试了smart_decode_type和decode_data模式用于scanData,但两者都返回null作为结果。你们觉得这有可能吗?我现在该怎么做?
私有乐趣createDataWedgeBroadcastReceiver(事件: EventSink?):BroadcastReceiver?{返回对象: BroadcastReceiver() {覆盖乐趣onReceive(上下文:上下文,意图:意图){ if ( =intent.getStringExtra(DWInterface.DATAWEDGE_SCAN_EXTRA_DATA_STRING) (PROFILE_INTENT_ACTION)){ // A条形码已被扫描为var scanData PROFILE_INTENT_ACTION var符号= intent.getStringExtra(DWInterface.DATAWEDGE_SCAN_EXTRA_LABEL_TYPE) var date = Calendar.getInstance().getTime() var df = SimpleDateFormat("dd/MM/yyyy :mm:ss“) var dateTimeString = df.format(date) var currentScan = Scan(scanData,符号( dateTimeString);Events?.success(currentScan.toJson()} //可以在这里处理来自DW的返回值,例如RETURN_GET_ACTIVE_PROFILE //或RETURN_ENUMERATE_SCANNERS }-私有乐趣createDataWedgeProfile(profileName: String) { //创建和配置与此应用程序//相关的DataWedge配置文件,以提高可读性,我还没有在DWInterface文件dwInterface.sendCommandString(this,DWInterface.DATAWEDGE_SEND_CREATE_PROFILE,profileName)中定义profileConfig = Bundle() profileConfig.putString("PROFILE_NAME",profileName) profileConfig.putString("PROFILE_ENABLED","true") //这些都是字符串profileConfig.putString("CONFIG_MODE",“更新”) val barcodeConfig = Bundle() barcodeConfig.putString("PLUGIN_NAME",(“条形码”) barcodeConfig.putString("RESET_CONFIG","true") /这是默认的,但不影响指定val barcodeProps = Bundle() barcodeConfig.putBundle("PARAM_LIST",barcodeProps) profileConfig.putBundle("PLUGIN_CONFIG",barcodeConfig) val appConfig = Bundle() appConfig.putString("PACKAGE_NAME",packageName) //将配置文件与此应用appConfig.putStringArray("ACTIVITY_LIST",arrayOf(“*”) profileConfig.putParcelableArray("APP_LIST",arrayOf(appConfig)) dwInterface.sendCommandBundle(this,DWInterface.DATAWEDGE_SEND_SET_CONFIG,profileConfig) //在某些DW版本中一次只能配置一个插件,现在执行意图输出profileConfig.remove("PLUGIN_CONFIG") val intentConfig = Bundle() intentConfig.putString("PLUGIN_NAME",“意向”) intentConfig.putString("RESET_CONFIG“),( intentProps.putString("intent_output_enabled",“真”) intentProps.putString("intent_action",PROFILE_INTENT_ACTION) intentProps.putString("intent_delivery",PROFILE_INTENT_BROADCAST) // "2“intentConfig.putBundle("PARAM_LIST",intentProps) profileConfig.putBundle("PLUGIN_CONFIG",intentConfig) dwInterface.sendCommandBundle(this,DWInterface.DATAWEDGE_SEND_SET_CONFIG,profileConfig) }
更新:对于任何面临同样问题的人来说,仅通过DataWedge应用程序编辑配置文件是行不通的。我所做的就是将这些添加到createDataWedgeProfile中,以启用RFID插件。
val rfidConfigParamList = Bundle()
rfidConfigParamList.putString("rfid_input_enabled", "true")
rfidConfigParamList.putString("rfid_beeper_enable", "true")
rfidConfigParamList.putString("rfid_led_enable", "true")
rfidConfigParamList.putString("rfid_antenna_transmit_power", "30")
rfidConfigParamList.putString("rfid_memory_bank", "2")
rfidConfigParamList.putString("rfid_session", "1")
rfidConfigParamList.putString("rfid_trigger_mode", "1")
rfidConfigParamList.putString("rfid_filter_duplicate_tags", "true")
rfidConfigParamList.putString("rfid_hardware_trigger_enabled", "true")
rfidConfigParamList.putString("rfid_tag_read_duration", "250")
val rfidConfigBundle = Bundle()
rfidConfigBundle.putString("PLUGIN_NAME", "RFID")
rfidConfigBundle.putString("RESET_CONFIG", "true")
rfidConfigBundle.putBundle("PARAM_LIST", rfidConfigParamList)
profileConfig.putBundle("PLUGIN_CONFIG", rfidConfigParamList)发布于 2021-10-01 17:55:18
数据将以字符串的形式传递。如果多个标签被读取,它们将被连在一起并发送到一个单一的意图中。
https://techdocs.zebra.com/datawedge/11-0/guide/output/intent/
标签: DATA_STRING_TAG
类型:字符串
名称:"com.symbol.datawedge.data_string“
内容:获取条形码字符
示例:"abcde12345“
https://stackoverflow.com/questions/69399099
复制相似问题