![]() |
Halyri - Mobiili
0.9
|
Makes all connection actions to server. User can connect, update information about device, personalinfo, medicalinfo or location. Uses SignalR for receiving and WCF for sending. More...
Public Member Functions | |
delegate void | MediaConfigurationRequestUpdated (object sender, EventArgs e, MediaConfigurationDto config) |
Invoked when media configuration update is requested. More... | |
delegate void | Connected () |
Invoked when connected More... | |
delegate void | InProcess () |
Invoked when connection is taken to process. More... | |
delegate void | Processed () |
Invoked when connection is processed. More... | |
delegate void | OpenMapRequest () |
Invoked when map is requested to open. More... | |
delegate void | CloseMapRequest () |
Invoked when map is requested to close. More... | |
delegate void | TextMessageReceived (String message) |
Invoked when there is textmessage received. More... | |
delegate void | MeasurementStartRequestReceived (MeasurementInstrumentDto instrument) |
Invoked when measurement data is requested to start with given instrument. More... | |
delegate void | MeasurementStopRequestReceived (MeasurementInstrumentDto instrument) |
Invoked when measurement sending is requested to stop with given instrument. More... | |
delegate void | MeasurementInstrumentListRequestReceived () |
Invoked when received request for measurement instrument list. More... | |
delegate void | ConnectionFailed () |
Invoked when connection has failed. More... | |
Connection () | |
Constructor that does nothing. More... | |
bool | Connect (UpdateConnectionPriorityRequest priority) |
Connects signalR and wcf with given priority and stores guid. Updates personalinfo, location and device info. More... | |
void | StartGpsTracking () |
Starts Gps tracking with DesiredAccuracy high ad MovementThreshold as assigned. Basicly when phone moves MovementThreshold amount, this is invoked. More... | |
void | Disconnect () |
Disconnects. More... | |
void | Reconnect (UpdateConnectionPriorityRequest priority) |
Reconnects with given priority. More... | |
void | UdpConnect () |
Connects udp. More... | |
void | UdpDisconnect () |
Disconnects udp. More... | |
bool | UdpMediaSend (MediaInformation mediaInfo, byte[] mediaData, int originalLength) |
Sends media with udp. More... | |
void | UpdatePriority (UpdateConnectionPriorityRequest priority) |
Adds guid to priority and then updates priority async. More... | |
void | UpdateLocation (LocationTypeDto type) |
Adds guid to location and then updates location async. More... | |
void | UpdatePersonalInfo (UpdatePersonalInfoRequest personalInfo) |
Adds guid to personalinfo and then updates personalinfo async. More... | |
void | UpdateDeviceInfo (UpdateDeviceInfoRequest deviceInfo) |
Adds guid to deviceinfo and then updates deviceinfo async. More... | |
void | UpdateMedicalInfo (UpdateMedicalInfoRequest medicalInfo) |
Adds guid to medicalinfo and then updates medicalinfo async. More... | |
void | SendMessage (String message) |
Makes new thread to send message to server so it won't block ui thread. More... | |
void | SwitchNoSound (bool value) |
Switch nosound. More... | |
void | UpdateLocationUserSpecified (System.Device.Location.GeoCoordinate coordinates) |
Updates Location with given goordinates as user specific type. More... | |
void | sendMedia (MediaInformationDto info, byte[] data, object userState) |
Sends media packet over the WCF connection to the server. More... | |
void | UpdateMeasurementInstrumentList (ObservableCollection< MeasurementInstrumentDto > instrumentList) |
Updates the provided list of measurement instruments to the server. More... | |
void | UploadMeasurementInstrumentData (MeasurementInstrumentDto instrument, byte[] data) |
Uploads the provided instrument data from the specified instrument to the server. More... | |
void | UpdateEmergencyType (string emergencyType) |
Updates EmergencyType. More... | |
Private Member Functions | |
void | UdpMediaPacketReceivedHandler (Object sender, MediaPacket media) |
Invoked when UdpMediaPacket is received and then invokes UdpMediaDataReceivedEvent. More... | |
void | UdpMediaSocketHasFaildedHandler (Object sender) |
Invoked when udp media socket has failed. Invokes only MediaSocektHasFailedEvent. More... | |
async Task | ConnectSignalR () |
Sends connect invoke to server and stores guid. More... | |
async Task | InitializeSignalR () |
Creates signalR hub and connects to it. Writes to debug if connects and creates proxy.on for location request. More... | |
void | connection_Received (string obj) |
Writes received obj to debug. More... | |
async Task | GetLocation () |
Gets phones location with high accuracy. If location is disabled shows aboutpromt in ui thread. Writes errors to debug. More... | |
void | ShowAboutPromtThread () |
Ui thread for showing aboutpromt that location is set disabled. Uses custom ok button. More... | |
void | Connection_Click (object sender, RoutedEventArgs e) |
For aboutpromts custom ok button. Closes aboutPromt. More... | |
void | geolocator_PositionChanged (Geolocator sender, PositionChangedEventArgs args) |
When phone is moved and this event is invoked -> updates location to server. More... | |
void | SendMessageThread (object message) |
Sends given message to server. More... | |
void | ClientUploadMediaSegmentCompleted (object sender, AsyncCompletedEventArgs e) |
Handles async media packet WCF uploading completed events. Republishes the event as MediaSendFinishedDelegate. More... | |
Private Attributes | |
bool | connected = false |
WcfMobileServiceClient | client |
String | guid = "" |
const string | udpServerAddress = "130.234.9.165" |
const int | udpServerPort = 15103 |
const String | SERVERADDRESS = "http://130.234.9.165:15100/HalyriServer/" |
const string | WCFADDRESS = "http://130.234.9.165:15100/HalyriServer/services/WcfMobileService.svc" |
const String | HUBPUBLICNAME = "SignalRMobileHub" |
const String | CONNECTMETHODNAME = "connect" |
const string | LOCATIONREQUESTEDMETHODNAME = "RequestLocationUpdate" |
const String | DISPLAYUSERLOCATIONMAP = "DisplayUserLocationMap" |
const String | CLOSEUSERLOCATIONMAP = "CloseUserLocationMap" |
const String | UPDATECONNECTIONSTATUS = "UpdateConnectionStatus" |
const String | INCOMINGTEXTMESSAGE = "IncomingTextMessage" |
const string | MEDIASTREAMINGMETHOD = "RequestMediaUpstreaming" |
const string | INSTRUMENTLISTREQUESTMETHOD = "GetInstrumentList" |
const string | MEASUREMENTSTARTREQUESTMETOD = "RequestStartMeasurement" |
const string | MEASUREMENTSTOPREQUESTMETOD = "RequestStopMeasurement" |
const String | DISCONNECTMETHODNAME = "Disconnect" |
const String | RECONNECTMETHODNAME = "Reconnect" |
IHubProxy | proxy |
Settings | settings = new Settings() |
UdpMediaClientSocket | udpSocket |
Geocoordinate | coordinates |
const int | movementThreasHoldForGeoLocator = 10 |
Geolocator | geolocator |
AboutPrompt | aboutPrompt |
Makes all connection actions to server. User can connect, update information about device, personalinfo, medicalinfo or location. Uses SignalR for receiving and WCF for sending.
<author>Atte Söderlund</author>
Halyri.Connection.Connection | ( | ) |
Constructor that does nothing.
|
private |
Handles async media packet WCF uploading completed events. Republishes the event as MediaSendFinishedDelegate.
<author>Veli-Mikko Puupponen</author>
sender | The sending object |
e | Async call completed event args |
delegate void Halyri.Connection.CloseMapRequest | ( | ) |
Invoked when map is requested to close.
bool Halyri.Connection.Connect | ( | UpdateConnectionPriorityRequest | priority | ) |
Connects signalR and wcf with given priority and stores guid. Updates personalinfo, location and device info.
priority | Priority |
delegate void Halyri.Connection.Connected | ( | ) |
Invoked when connected
|
private |
For aboutpromts custom ok button. Closes aboutPromt.
|
private |
Writes received obj to debug.
obj | Received string |
delegate void Halyri.Connection.ConnectionFailed | ( | ) |
Invoked when connection has failed.
|
private |
Sends connect invoke to server and stores guid.
void Halyri.Connection.Disconnect | ( | ) |
Disconnects.
|
private |
When phone is moved and this event is invoked -> updates location to server.
|
private |
Gets phones location with high accuracy. If location is disabled shows aboutpromt in ui thread. Writes errors to debug.
|
private |
Creates signalR hub and connects to it. Writes to debug if connects and creates proxy.on for location request.
delegate void Halyri.Connection.InProcess | ( | ) |
Invoked when connection is taken to process.
delegate void Halyri.Connection.MeasurementInstrumentListRequestReceived | ( | ) |
Invoked when received request for measurement instrument list.
delegate void Halyri.Connection.MeasurementStartRequestReceived | ( | MeasurementInstrumentDto | instrument | ) |
Invoked when measurement data is requested to start with given instrument.
instrument | Instrument |
delegate void Halyri.Connection.MeasurementStopRequestReceived | ( | MeasurementInstrumentDto | instrument | ) |
Invoked when measurement sending is requested to stop with given instrument.
instrument | Instrument |
delegate void Halyri.Connection.MediaConfigurationRequestUpdated | ( | object | sender, |
EventArgs | e, | ||
MediaConfigurationDto | config | ||
) |
Invoked when media configuration update is requested.
config |
delegate void Halyri.Connection.OpenMapRequest | ( | ) |
Invoked when map is requested to open.
delegate void Halyri.Connection.Processed | ( | ) |
Invoked when connection is processed.
void Halyri.Connection.Reconnect | ( | UpdateConnectionPriorityRequest | priority | ) |
Reconnects with given priority.
priority | Priority |
void Halyri.Connection.sendMedia | ( | MediaInformationDto | info, |
byte[] | data, | ||
object | userState | ||
) |
Sends media packet over the WCF connection to the server.
<author>Veli-Mikko Puupponen</author>
info | Information describing the media |
data | Media data |
userState | User state object for tracking corresponding async operation completed event for this send call |
void Halyri.Connection.SendMessage | ( | String | message | ) |
Makes new thread to send message to server so it won't block ui thread.
message | Message |
|
private |
Sends given message to server.
message | Message |
|
private |
Ui thread for showing aboutpromt that location is set disabled. Uses custom ok button.
void Halyri.Connection.StartGpsTracking | ( | ) |
Starts Gps tracking with DesiredAccuracy high ad MovementThreshold as assigned. Basicly when phone moves MovementThreshold amount, this is invoked.
void Halyri.Connection.SwitchNoSound | ( | bool | value | ) |
Switch nosound.
value | Value to where to switch |
delegate void Halyri.Connection.TextMessageReceived | ( | String | message | ) |
Invoked when there is textmessage received.
message | Received message |
void Halyri.Connection.UdpConnect | ( | ) |
Connects udp.
<author>Veli-Mikko Puupponen</author>
void Halyri.Connection.UdpDisconnect | ( | ) |
Disconnects udp.
<author>Veli-Mikko Puupponen</author>
|
private |
Invoked when UdpMediaPacket is received and then invokes UdpMediaDataReceivedEvent.
<author>Veli-Mikko Puupponen</author>
bool Halyri.Connection.UdpMediaSend | ( | MediaInformation | mediaInfo, |
byte[] | mediaData, | ||
int | originalLength | ||
) |
Sends media with udp.
<author>Veli-Mikko Puupponen</author>
mediaInfo | Media information |
mediaData | Data |
originalLength | Lenght |
|
private |
Invoked when udp media socket has failed. Invokes only MediaSocektHasFailedEvent.
<author>Veli-Mikko Puupponen</author>
void Halyri.Connection.UpdateDeviceInfo | ( | UpdateDeviceInfoRequest | deviceInfo | ) |
Adds guid to deviceinfo and then updates deviceinfo async.
deviceInfo | Deviceinfo to update |
void Halyri.Connection.UpdateEmergencyType | ( | string | emergencyType | ) |
Updates EmergencyType.
emergencyType | Type |
void Halyri.Connection.UpdateLocation | ( | LocationTypeDto | type | ) |
Adds guid to location and then updates location async.
location | Location to update |
void Halyri.Connection.UpdateLocationUserSpecified | ( | System.Device.Location.GeoCoordinate | coordinates | ) |
Updates Location with given goordinates as user specific type.
coordinates | Goordinates |
void Halyri.Connection.UpdateMeasurementInstrumentList | ( | ObservableCollection< MeasurementInstrumentDto > | instrumentList | ) |
Updates the provided list of measurement instruments to the server.
<author>Niko Mononen</author>
instrumentList | List of available measurement instruments on the device |
void Halyri.Connection.UpdateMedicalInfo | ( | UpdateMedicalInfoRequest | medicalInfo | ) |
Adds guid to medicalinfo and then updates medicalinfo async.
medicalInfo | Medicalinfo to update |
void Halyri.Connection.UpdatePersonalInfo | ( | UpdatePersonalInfoRequest | personalInfo | ) |
Adds guid to personalinfo and then updates personalinfo async.
personalInfo | Personalinfo to update |
void Halyri.Connection.UpdatePriority | ( | UpdateConnectionPriorityRequest | priority | ) |
Adds guid to priority and then updates priority async.
priority | Priority to update |
void Halyri.Connection.UploadMeasurementInstrumentData | ( | MeasurementInstrumentDto | instrument, |
byte[] | data | ||
) |
Uploads the provided instrument data from the specified instrument to the server.
<author>Niko Mononen</author>
instrument | Source instrument of the measurement data |
data | Data provided by the instrument |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
MediaConfigurationRequestUpdated Halyri.Connection.MediaConfigurationUpdatedEvent |
MediaSendFinishedDelegate Halyri.Connection.MediaSendFinishedEvent |
MediaSocketHasFailed Halyri.Connection.MediaSocketHasFailedEvent |
|
private |
|
private |
|
private |
|
private |
|
private |
UdpMediaDataReceived Halyri.Connection.UdpMediaDataReceivedEvent |
|
private |
|
private |
|
private |
|
private |
|
private |
CloseMapRequest Halyri.Connection.CloseMapRequestEvent |
Connected Halyri.Connection.ConnectedEvent |
ConnectionFailed Halyri.Connection.ConnectionFailedEvent |
InProcess Halyri.Connection.InProcessEvent |
MeasurementInstrumentListRequestReceived Halyri.Connection.MeasurementInstrumentListRequestReceivedEvent |
MeasurementStartRequestReceived Halyri.Connection.MeasurementStartRequestReceivedEvent |
MeasurementStopRequestReceived Halyri.Connection.MeasurementStopRequestReceivedEvent |
OpenMapRequest Halyri.Connection.OpenMapRequestEvent |
Processed Halyri.Connection.ProcessedEvent |
TextMessageReceived Halyri.Connection.TextMessageReceivedEvent |