C# Class Kreyos.SDK.Bluetooth.Protocol

Exibir arquivo Open project: kreyosopensource/KreyosWP

Public Methods

Method Description
LoadDataFile ( String fileName ) : Task
LoadDataFromBuffer ( byte buffer ) : ActivityDataDoc
Protocol ( BluetoothAgent btAgent ) : System
activityHeartbeat ( string activityId ) : void
buildSyncTimePack ( ) : byte[]
buildSyncTimePackFromInput ( System.DateTime p_date ) : byte[]
buildWatchConfig ( String worldClocks, int worldClockOffset, bool isDigitalClock, int digitalClock, int analogClock, int sportsGrid, int sportsGrids, int goals, int weight, int height, bool enableGesture, bool isLeftHandGesture, int gestureActionsTable, bool isUkUnit ) : byte[]
bytesToInt ( byte buf, int start ) : int
bytesToShort ( byte buf, int start ) : int
deleteFile ( string fileName ) : void
echo ( string hint ) : void
getActivityData ( ) : void
getDeviceID ( ) : void
getSportsData ( ) : void
getSportsGrid ( ) : void
handlePacket ( byte packet ) : void
handle_activity ( byte pack, int handle ) : void
handle_file ( byte pack, int handle ) : void
handle_today_activity ( byte pack, int handle ) : void
intToByteArray ( int i ) : byte[]
listFile ( string prefix ) : void
longToByteArray ( long s ) : byte[]
notifyMessage ( string type, string identity, string message ) : void
readFile ( string filename ) : void
sendDailyActivityRequest ( ) : void
sendGPSInfo ( Geoposition geoPosition, int distance, int calories ) : void
sendGPSInfo ( short spd, short alt, int distance, int calories ) : void
sendStream ( string name, Stream stream ) : bool
sendStream ( string name, StreamReader sr ) : bool
setGestureControl ( bool enable, bool isLeftHand, int action_map ) : void
setWatchAlarm ( int index, int mode, int monthday, int weekday, int hour, int minute ) : void
setWatchGrid ( ) : void
shortToByteArray ( short s ) : byte[]
syncTime ( ) : void
syncTimeFromInput ( System.DateTime p_date ) : void
syncWatchConfig ( String worldClocks, int worldClockOffset, bool isDigitalClock, int digitalClock, int analogClock, int sportsGrid, int sportsGrids, int goals, int weight, int height, bool enableGesture, bool isLeftHandGesture, int gestureActionsTable, bool isUkUnit ) : void
unlockWatch ( ) : void

Private Methods

Method Description
GET_PACKET_END ( byte pack ) : int
GetValue ( int rawValue, ActivityDataRow dtype ) : double
LoadData ( DataReader reader ) : ActivityDataDoc
buildDataBuffer ( List buflist ) : byte[]
buildElement ( byte packet, int offset, string type, byte data ) : int
buildElementHead ( byte packet, int offset, string type, byte len ) : int
buildPacketHead ( byte packet ) : int
buildSingleElementPacket ( string type, byte data ) : byte[]
estimateElementHeadSize ( string type ) : int
estimateStringSize ( string type ) : int
fillElementData ( byte packet, int offset, byte data, int from, int len ) : int
get_body_length ( byte pack ) : int
get_element_data ( byte pack, int handle ) : byte[]
get_element_data_size ( byte pack, int handle ) : int
get_element_type ( byte pack, int handle ) : byte[]
get_first_element ( byte pack ) : int
get_first_sub_element ( byte pack, int parent ) : int
get_flag ( byte pack ) : int
get_next_element ( byte pack, int handle ) : int
get_next_sub_element ( byte pack, int parent, int handle ) : int
get_sequence ( byte pack ) : int
get_version ( byte pack ) : int
hexdump ( byte buffer ) : void
sendFileBuffer ( string fileName, byte buffer, int fileLen ) : bool

Method Details

LoadDataFile() public method

public LoadDataFile ( String fileName ) : Task
fileName String
return Task

LoadDataFromBuffer() public method

public LoadDataFromBuffer ( byte buffer ) : ActivityDataDoc
buffer byte
return ActivityDataDoc

Protocol() public method

public Protocol ( BluetoothAgent btAgent ) : System
btAgent BluetoothAgent
return System

activityHeartbeat() public method

public activityHeartbeat ( string activityId ) : void
activityId string
return void

buildSyncTimePack() public method

public buildSyncTimePack ( ) : byte[]
return byte[]

buildSyncTimePackFromInput() public method

public buildSyncTimePackFromInput ( System.DateTime p_date ) : byte[]
p_date System.DateTime
return byte[]

buildWatchConfig() public method

public buildWatchConfig ( String worldClocks, int worldClockOffset, bool isDigitalClock, int digitalClock, int analogClock, int sportsGrid, int sportsGrids, int goals, int weight, int height, bool enableGesture, bool isLeftHandGesture, int gestureActionsTable, bool isUkUnit ) : byte[]
worldClocks String
worldClockOffset int
isDigitalClock bool
digitalClock int
analogClock int
sportsGrid int
sportsGrids int
goals int
weight int
height int
enableGesture bool
isLeftHandGesture bool
gestureActionsTable int
isUkUnit bool
return byte[]

bytesToInt() public static method

public static bytesToInt ( byte buf, int start ) : int
buf byte
start int
return int

bytesToShort() public static method

public static bytesToShort ( byte buf, int start ) : int
buf byte
start int
return int

deleteFile() public method

public deleteFile ( string fileName ) : void
fileName string
return void

echo() public method

public echo ( string hint ) : void
hint string
return void

getActivityData() public method

public getActivityData ( ) : void
return void

getDeviceID() public method

public getDeviceID ( ) : void
return void

getSportsData() public method

public getSportsData ( ) : void
return void

getSportsGrid() public method

public getSportsGrid ( ) : void
return void

handlePacket() public method

public handlePacket ( byte packet ) : void
packet byte
return void

handle_activity() public method

public handle_activity ( byte pack, int handle ) : void
pack byte
handle int
return void

handle_file() public method

public handle_file ( byte pack, int handle ) : void
pack byte
handle int
return void

handle_today_activity() public method

public handle_today_activity ( byte pack, int handle ) : void
pack byte
handle int
return void

intToByteArray() public static method

public static intToByteArray ( int i ) : byte[]
i int
return byte[]

listFile() public method

public listFile ( string prefix ) : void
prefix string
return void

longToByteArray() public static method

public static longToByteArray ( long s ) : byte[]
s long
return byte[]

notifyMessage() public method

public notifyMessage ( string type, string identity, string message ) : void
type string
identity string
message string
return void

readFile() public method

public readFile ( string filename ) : void
filename string
return void

sendDailyActivityRequest() public method

public sendDailyActivityRequest ( ) : void
return void

sendGPSInfo() public method

public sendGPSInfo ( Geoposition geoPosition, int distance, int calories ) : void
geoPosition Windows.Devices.Geolocation.Geoposition
distance int
calories int
return void

sendGPSInfo() public method

public sendGPSInfo ( short spd, short alt, int distance, int calories ) : void
spd short
alt short
distance int
calories int
return void

sendStream() public method

public sendStream ( string name, Stream stream ) : bool
name string
stream Stream
return bool

sendStream() public method

public sendStream ( string name, StreamReader sr ) : bool
name string
sr System.IO.StreamReader
return bool

setGestureControl() public method

public setGestureControl ( bool enable, bool isLeftHand, int action_map ) : void
enable bool
isLeftHand bool
action_map int
return void

setWatchAlarm() public method

public setWatchAlarm ( int index, int mode, int monthday, int weekday, int hour, int minute ) : void
index int
mode int
monthday int
weekday int
hour int
minute int
return void

setWatchGrid() public method

public setWatchGrid ( ) : void
return void

shortToByteArray() public static method

public static shortToByteArray ( short s ) : byte[]
s short
return byte[]

syncTime() public method

public syncTime ( ) : void
return void

syncTimeFromInput() public method

public syncTimeFromInput ( System.DateTime p_date ) : void
p_date System.DateTime
return void

syncWatchConfig() public method

public syncWatchConfig ( String worldClocks, int worldClockOffset, bool isDigitalClock, int digitalClock, int analogClock, int sportsGrid, int sportsGrids, int goals, int weight, int height, bool enableGesture, bool isLeftHandGesture, int gestureActionsTable, bool isUkUnit ) : void
worldClocks String
worldClockOffset int
isDigitalClock bool
digitalClock int
analogClock int
sportsGrid int
sportsGrids int
goals int
weight int
height int
enableGesture bool
isLeftHandGesture bool
gestureActionsTable int
isUkUnit bool
return void

unlockWatch() public method

public unlockWatch ( ) : void
return void