Skip to content

Instantly share code, notes, and snippets.

@adrianogil
Created June 10, 2014 01:09
Show Gist options
  • Save adrianogil/5db2e9ff623fc72a8c6e to your computer and use it in GitHub Desktop.
Save adrianogil/5db2e9ff623fc72a8c6e to your computer and use it in GitHub Desktop.
Conexão NFC usando Proximity
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