public BleConnectorInitData (string portName, Bytes service, bool debug, int portThreadSleep) { this.PortName = portName; this.ServiceUUID = service; this.Debug = debug; this.PortThreadSleep = portThreadSleep; }
public void DeSerialize (Bytes bytes) { using (ByteDeserializer bd = new ByteDeserializer (bytes)) { Event = bd.DeSerializeClassifierEvent (); switch (Event) { case ProtocolClassifierEvent.ArmSynced: { Arm = bd.DeSerializeArm (); Direction = bd.DeSerializeBraceletDirection (); break; } case ProtocolClassifierEvent.Pose: { Pose = bd.DeSerializePose (); break; } case ProtocolClassifierEvent.SyncFailed: { SyncResult = bd.DeSerializeSyncResult (); break; } } } }
public BleWriteAttribute (BleProtocol ble, SerialPort port, byte connection, ushort attributeHandle, Bytes value) : base (ble, port) { this.Connection = connection; this.AttributeHandle = attributeHandle; this.Value = value; }
public void DeSerialize (Bytes bytes) { using (ByteDeserializer bd = new ByteDeserializer (bytes)) { EmgData = bd.DeSerializeBytes (EMG_DATA_SIZE); } }
public BlePeripheralService (Bytes UUID, ushort startHandle, ushort endHandle) { this.Attributes = new List<BlePeripheralAttribute> (); this.Characteristics = new List<BlePeripheralCharacteristic> (); this.ServiceUUID = UUID; this.StartHandle = startHandle; this.EndHandle = endHandle; }
public void DeSerialize (Bytes bytes) { using (ByteDeserializer bd = new ByteDeserializer (bytes)) { Event = bd.DeSerializeMotionEvent (); TapDirection = bd.DeSerializeByte (); TapCount = bd.DeSerializeByte (); } }
public void DeSerialize (Bytes bytes) { using (ByteDeserializer bd = new ByteDeserializer (bytes)) { // ORDER IS MANDATORY Major = bd.DeSerializeUshort (); Minor = bd.DeSerializeUshort (); Patch = bd.DeSerializeUshort (); HardwareRevision = bd.DeSerializeHardwareRevision (); } }
public void DeSerialize (Bytes bytes) { using (ByteDeserializer bd = new ByteDeserializer (bytes)) { // ORDER IS MANDATORY OrientationW = bd.DeSerializeShort (); OrientationX = bd.DeSerializeShort (); OrientationY = bd.DeSerializeShort (); OrientationZ = bd.DeSerializeShort (); Accelerometer = bd.DeSerializeShorts (ACCELEROMETER_DATA_LENGTH); Gyroscope = bd.DeSerializeShorts (GYROSCOPE_DATA_LENGTH); } }
public void DeSerialize (Bytes bytes) { using (ByteDeserializer bd = new ByteDeserializer (bytes)) { // ORDER IS MANDATORY SerialNumber = bd.DeSerializeBytes (SERIAL_NUMBER_LENGTH); UnlockPose = bd.DeSerializePose (); ActiveClassifierType = bd.DeSerializeClassifierModel (); ActiveClassifierIndex = bd.DeSerializeByte (); HasCustomClassifier = bd.DeSerializeBool (); StreamIndicating = bd.DeSerializeByte (); Sku = bd.DeSerializeSku (); Reserved = bd.DeSerializeBytes (RESERVED_LENGTH); } }
public Task Send(ArraySegment<byte> data, params object[] connectionIDs) { var bytes = new Bytes { value = data.Array, offset = data.Offset, length = data.Count }; if (connectionIDs == null || connectionIDs.Length <= 0) _writer.write_untyped(bytes, ref InstanceHandle_t.HANDLE_NIL); else { for (int i = 0; i < connectionIDs.Length; i++) { var handle = connectionIDs[i] == null ? InstanceHandle_t.HANDLE_NIL : (InstanceHandle_t)connectionIDs[i]; _writer.write_untyped(bytes, ref handle); } } return Task.FromResult(true); }
public override void on_data_available(DataReader reader) { var bytes = new Bytes(); var info = new SampleInfo(); reader.take_next_sample_untyped(bytes, info); if (bytes.value != null) { var args = new DataReceivedArgs { Data = new ArraySegment<byte>(bytes.value, bytes.offset, bytes.length), SessionID = info.instance_handle }; Received.Invoke(this, args); } }
public int send(Bytes data, [DefaultParameterValue(0)] int flags) { byte[] buffer = data.GetUnsafeByteArray(); try { return _socket.Send(buffer, (SocketFlags)flags); } catch (Exception e) { throw MakeException(_context, e); } }
public static Sha256Object sha256(Bytes data) { return new Sha256Object((IList<byte>)data); }
public void update(Bytes newBytes) { update((IList<byte>)newBytes); }
public void DeSerialize (Bytes bytes) { throw new InvalidOperationException ("DeSerialize is not possible for ~CommandType-s"); }
public byte[] Any(Bytes request) { return Guid.Parse(request.Text).ToByteArray(); }
private Bytes FinishBytesPlus(Bytes s) { Token t = PeekToken(); while (true) { if (t is ConstantValueToken) { Bytes cvs; if ((cvs = t.Value as Bytes) != null) { s = s + cvs; NextToken(); t = PeekToken(); continue; } else { ReportSyntaxError("invalid syntax"); } } break; } return s; }
public _Array from_buffer_copy(Bytes array, [DefaultParameterValue(0)]int offset) { ValidateArraySizes(array, offset, ((INativeType)this).Size); _Array res = (_Array)CreateInstance(Context.SharedContext); res._memHolder = new MemoryHolder(((INativeType)this).Size); for (int i = 0; i < ((INativeType)this).Size; i++) { res._memHolder.WriteByte(i, array._bytes[i]); } return res; }
public void update(Bytes newData) { update((IList<byte>)newData); }
public BlePeripheralCharacteristic FindCharacteristicByUUID (Bytes uuid) { return CharacteristicMap[uuid]; }
public void VisitBytes(Bytes b) { throw new NotImplementedException(); }
public BlePeripheralCharacteristic (Bytes uuid, ushort handle) { this.AttributeUUID = uuid; this.Handle = handle; }
public CharacteristicValueChangedEventArgs (Bytes uuid, Bytes value) { this.CharacteristicUUID = uuid; this.Value = value; }
public void sendall(Bytes data, [DefaultParameterValue(0)] int flags) { sendallWorker(data.GetUnsafeByteArray(), flags); }
public static MD5Type @new(Bytes data) { return new MD5Type((IList<byte>)data); }
public int sendto(Bytes data, int flags, PythonTuple address) { byte[] buffer = data.GetUnsafeByteArray(); EndPoint remoteEP = TupleToEndPoint(_context, address, _socket.AddressFamily, out _hostName); try { return _socket.SendTo(buffer, (SocketFlags)flags, remoteEP); } catch (Exception e) { throw MakeException(_context, e); } }
public static byte[] GetBytes(Bytes bytes) { return bytes._bytes; }
public int sendto(Bytes data, PythonTuple address) { return sendto(data, 0, address); }
private static void ValidateArraySizes(Bytes bytes, int offset, int size) { ValidateArraySizes(bytes.Count, offset, size); }
public static sha @new(Bytes data) { return new sha((IList<byte>)data); }