Ios蓝牙通讯组件。
属性 |
属性说明 |
---|---|
BluetoothStatus |
蓝牙状态。 |
方法 |
方法说明 |
---|---|
iOSCloseConnectBle |
Ios断开连接指定低功耗蓝牙。 |
iOSConnectBle |
连接指定低功耗蓝牙。 |
ConnectWithSearch |
连接指定蓝牙,在未配对的情况下会尝试搜索连接 |
iOSDiscoverUuid |
Ios搜索指定已连接设备的服务。 |
iOSReadBleData |
Ios读取蓝牙设备数据。 |
iOSStartNotification |
Ios打开蓝牙的订阅。 |
iOSSearchBle |
Ios查找低功耗蓝牙。 |
iOSScanAndConnectBle |
Ios扫描并连接指定的低功耗蓝牙。 |
iOSStopNotification |
Ios关闭蓝牙的订阅。 |
C#: bluetooth1.iOSStartNotification("0000fff0-0000-1000-8000-00805f9b34fb", "0000fff0-0000-1000-8000-00805f9b34fb", "0000fff0-0000-1000-8000-00805f9b34fb", (abj, args) => { if (args.isError == false) Toast($"state{args.State}"); else Toast(args.error); });
C#: bluetooth1.iOSStopNotification("0000fff0-0000-1000-8000-00805f9b34fb", "0000fff0-0000-1000-8000-00805f9b34fb", "0000fff0-0000-1000-8000-00805f9b34fb", (abj, args) => { if (args.isError == false) Toast($"state{args.State}"); else Toast(args.error); });
C#: bluetooth1.iOSCloseConnectBle("0000fff0-0000-1000-8000-00805f9b34fb", (abj, args) => { if (args.isError == false) Toast($"state{args.State}"); else Toast(args.error); });
C#: bluetooth1.iOSSearchBle((abj, args) => { if (args.isError == false) { string str = ""; foreach(var item inargs.Data) { str += "name:" + item.Name + "mac:" + item.Mac + "rssi:" + item.Rssi + "uuid" + item.Uuid; } Toast(str); } else Toast(args.error); });
C#: bluetooth1.iOSConnectBle("0000fff0-0000-1000-8000-00805f9b34fb", (abj, args) => { if (args.isError == false) { Toast($"name:{args.Name} message:{args.Message}"); } else Toast(args.error); });
C#: bluetooth1.iOSScanAndConnectBle("0000fff0-0000-1000-8000-00805f9b34fb",CC:78:AB:AB:5A:3D"",(abj, args) => { if (args.isError == false) { Toast($"name:{args.Name} message:{args.Message}"); } else Toast(args.error); });
C#: bluetooth1.ConnectWithSearch("00:0D:18:00:19:98", (abj, args) => { if (args.isError == true) Toast(args.error); else Toast("success"); });
C#: bluetooth1.iOSDiscoverUuid("0000fff0-0000-1000-8000-00805f9b34fb", (abj, args) => { if (args.isError == false) { string str = ""; if (args.Characteristis.Length > 0) { foreach(stringitem inargs.Characteristis) str += item + ""; Toast($"uuid:{args.ServiceUUID}Characteristis: {str}"); } } else Toast(args.error); });
C#: bluetooth1.iOSReadBleData("0000fff0-0000-1000-8000-00805f9b34fb", "0000fff0-0000-1000-8000-00805f9b34fb", "0000fff0-0000-1000-8000-00805f9b34fb",(abj, args) => { if (args.isError == false) { Toast(args.Value); } else Toast(args.error); });
C#: string str = "690000001"; string print = "SIZE 80 mm,40 mm\r\n" + "REFERENCE 0,0\r\n" + "SPEED 4.0\r\n" + "DENSITY 8\r\n" + "SET PEEL OFF\r\n" + "SET CUTTER OFF\r\n" + "SET TEAR ON\r\n" + "DIRECTION 0\r\n" + "SHIFT 0\r\n" + "OFFSET 0 mm\r\n" + "CLS\r\n" + "BARCODE 20,20,\"128M\",160,1,0,4,12,\"" + str + "\"\r\n" + "TEXT 20,190,\"ARIAL.TTF\",0,15,15,\"" + str + "\"\n" + "PRINT 3,1\r\n"; bluetooth1.iOSWriteBleData("0000fff0-0000-1000-8000-00805f9b34fb", "0000fff0-0000-1000-8000-00805f9b34fb", "0000fff0-0000-1000-8000-00805f9b34fb",print1,(abj, args) => { if (args.isError == false) Toast("success"); else Toast(args.error); });