C# 클래스 Flint.Core.PebbleProtocol

Handles the basic protocol structure for Pebble communication. Essentially handles the SerialPort and translates the stream to endpoint,payload pairs and vv. Does and should not handle anything regarding the *meaning* of that data.
파일 보기 프로젝트 열기: barometz/flint 1 사용 예제들

공개 메소드들

메소드 설명
Close ( ) : void
ConnectAsync ( ) : System.Threading.Tasks.Task

Connect to the Pebble.

PebbleProtocol ( IBluetoothConnection connection ) : System

Create a new Pebble connection

SendMessage ( ushort endpoint, byte payload ) : void

Send a message to the connected Pebble. The payload should at most be 2048 bytes large.

비공개 메소드들

메소드 설명
ReadAndProcessBytes ( ) : bool

Read from the serial line if a useful chunk is present.

In this case a "useful chunk" means that either the payload size and endpoint of a new message or the complete payload of a message are present.

ReadBytes ( int count ) : byte[]
SerialPortDataReceived ( object sender, BytesReceivedEventArgs e ) : void

메소드 상세

Close() 공개 메소드

public Close ( ) : void
리턴 void

ConnectAsync() 공개 메소드

Connect to the Pebble.
Passed on when no connection can be made.
public ConnectAsync ( ) : System.Threading.Tasks.Task
리턴 System.Threading.Tasks.Task

PebbleProtocol() 공개 메소드

Create a new Pebble connection
public PebbleProtocol ( IBluetoothConnection connection ) : System
connection IBluetoothConnection
리턴 System

SendMessage() 공개 메소드

Send a message to the connected Pebble. The payload should at most be 2048 bytes large.
Thrown when the payload is too large.
public SendMessage ( ushort endpoint, byte payload ) : void
endpoint ushort
payload byte
리턴 void