Created
June 10, 2014 01:09
-
-
Save adrianogil/5db2e9ff623fc72a8c6e to your computer and use it in GitHub Desktop.
Conexão NFC usando Proximity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StreamSocket _streamSocket; | |
void OnTriggeredConnectionStateChanged(object sender, TriggeredConnectionStateChangedEventArgs args) | |
{ | |
switch (args.State) | |
{ | |
case TriggeredConnectState.Listening: | |
// Conectando como ouvinte | |
break; | |
case TriggeredConnectState.PeerFound: | |
// Identificação de proximidade foi realizada, restando iniciar o processo de estabelecer a | |
// conexão utilizando um dos canais de comunicação disponíveis, como TCP/IP ou Bluetooth | |
break; | |
case TriggeredConnectState.Connecting: | |
// Conectando como cliente | |
break; | |
case TriggeredConnectState.Completed: | |
// Conexão completa, obtém socket responsável pelo envio de dados | |
_streamSocket = args.Socket; | |
break; | |
case TriggeredConnectState.Canceled: | |
break; | |
case TriggeredConnectState.Failed: | |
// Connection was unsuccessful | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment