SlideShare a Scribd company logo
1 of 60
Download to read offline
Comunicandonuestras appscon el mundo exterior 
Roberto Luis Bisbé 
rlbisbe.net 
@rlbisbe
@rlbisbe 
•Ingeniero en Informática @ UAM 
•Desarrollador @ frontiers 
•WP, W8 & Android dev 
•rlbisbe.net
Corría el año2006…
Corría el año2006…
Penetrómetro
Penetrómetro
.NET Compact 
Framework 
.NET 
Framework 
USB 
RemoteAPI
Comunicarnuestras appscon el mundo exterior
Imagen: https://flic.kr/p/aKN6u6 
Examinandola superficie
RaspberryPI 
•ARM 
•Linux 
•USB 
•Ethernet 
•Sensores
RaspberryPI 
•ARM 
•Linux 
•USB 
•Ethernet 
•Sensores
API REST!
Web Sockets
! Web Socket 
•SignalR 
•.NET 
•socket.io 
•node.js 
•Python 
•faye 
•ruby
Qué es WebSocket 
•Bidireccional 
•HTTP 
•Soporte nativo en 8.x
Servidor 
varserver = http.createServer(app) 
server.listen(1430) 
varwss= new WebSocketServer({ server: server }); 
wss.on("connection", function(ws) { 
ws.on("message", function(data) { 
ws.send("response"); 
}) 
ws.on("close", function() { 
//Closed 
}) 
}
Servidor 
varserver = http.createServer(app) 
server.listen(1430) 
varwss= new WebSocketServer({ server: server }); 
wss.on("connection", function(ws) { 
ws.on("message", function(data) { 
ws.send("response"); 
}) 
ws.on("close", function() { 
//Closed 
}) 
}
Servidor 
varserver = http.createServer(app) 
server.listen(1430) 
varwss= new WebSocketServer({ server: server }); 
wss.on("connection", function(ws) { 
ws.on("message", function(data) { 
ws.send("response"); 
}) 
ws.on("close", function() { 
//Closed 
}) 
}
Cliente -Conexión 
varwebSocket= new MessageWebSocket(); 
webSocket.Control.MessageType= SocketMessageType.Utf8; 
webSocket.MessageReceived+= ProcessMessageReceived; 
webSocket.Closed+= Closed; 
awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
Cliente -Conexión 
ver webSocket= new MessageWebSocket(); 
webSocket.Control.MessageType= SocketMessageType.Utf8; 
webSocket.MessageReceived+= ProcessMessageReceived; 
webSocket.Closed+= Closed; 
awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
Cliente -Conexión 
ver webSocket= new MessageWebSocket(); 
webSocket.Control.MessageType= SocketMessageType.Utf8; 
webSocket.MessageReceived+= ProcessMessageReceived; 
webSocket.Closed+= Closed; 
awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
Cliente -Conexión 
ver webSocket= new MessageWebSocket(); 
webSocket.Control.MessageType= SocketMessageType.Utf8; 
webSocket.MessageReceived+= ProcessMessageReceived; 
webSocket.Closed+= Closed; 
awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
Cliente -Envío y recepción 
var_messageWriter= new DataWriter(webSocket.OutputStream); 
_messageWriter.WriteString(message); 
await_messageWriter.StoreAsync(); 
varstream = new 
StreamReader(args.GetDataStream().AsStreamForRead()); 
stringmessage= stream.ReadToEnd();
Cliente -Envío y recepción 
var_messageWriter= new DataWriter(webSocket.OutputStream); 
_messageWriter.WriteString(message); 
await_messageWriter.StoreAsync(); 
varstream = new 
StreamReader(args.GetDataStream().AsStreamForRead()); 
stringmessage= stream.ReadToEnd();
Ejemplo completo 
DEMO 
C# 
Node JS 
WebSocket
WebSocket 
•Bidireccional 
•HTTP 
•Soporte nativo en 8.x
Bajando de nivel 
Imagen: https://flic.kr/p/aKN6u6
StreamSockets 
•Flujo de datos sobre TCP 
•Texto, imágenes, audio, vídeo… 
•Permisos
Servidor -Conexión 
varlistenSocket= new StreamSocketListener(); 
listenSocket.ConnectionReceived+= ConnectionReceived; 
awaitlistenSocket.BindServiceNameAsync("5000");
Servidor -Recepción 
DataReaderreader= new DataReader(connectionSocket.InputStream); 
uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); 
if(sizeFieldCount!= sizeof(long)) return; 
uintresultLength= (uint)reader.ReadInt32(); 
uintactualResultLength= awaitreader.LoadAsync(resultLength); 
if(resultLength!= actualResultLength) return; 
varbyteResult= new byte[resultLength]; 
reader.ReadBytes(byteResult);
Servidor -Recepción 
DataReaderreader= new DataReader(connectionSocket.InputStream); 
uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); 
if(sizeFieldCount!= sizeof(long)) return; 
uintresultLength= (uint)reader.ReadInt32(); 
uintactualResultLength= awaitreader.LoadAsync(resultLength); 
if(resultLength!= actualResultLength) return; 
varbyteResult= new byte[resultLength]; 
reader.ReadBytes(byteResult);
Servidor -Recepción 
uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); 
if(sizeFieldCount!= sizeof(long)) return; 
uintresultLength= (uint)reader.ReadInt32(); 
uintactualResultLength= awaitreader.LoadAsync(resultLength); 
if(resultLength!= actualResultLength) return; 
varbyteResult= new byte[resultLength]; 
reader.ReadBytes(byteResult);
Cliente -Conexión 
varconnectionSocket= new StreamSocket(); 
varserverHost= new HostName(server); 
awaitconnectionSocket.ConnectAsync(serverHost, port);
Cliente -Envío 
varwriter= new DataWriter(connectionSocket.OutputStream); 
writer.WriteInt32(bytes.Length); 
writer.WriteBytes(bytes); 
awaitwriter.StoreAsync(); 
writer.DetachStream();
Cliente -Envío 
varwriter= new DataWriter(connectionSocket.OutputStream); 
writer.WriteInt32(bytes.Length); 
writer.WriteBytes(bytes); 
awaitwriter.StoreAsync(); 
writer.DetachStream();
Cliente -Envío 
varwriter= new DataWriter(connectionSocket.OutputStream); 
writer.WriteInt32(bytes.Length); 
writer.WriteBytes(bytes); 
awaitwriter.StoreAsync(); 
writer.DetachStream();
Ejemplo completo 
DEMO 
WinRTC# 
WinRTC# 
Socket
StreamSockets 
•Flujo de datos sobre TCP 
•Texto, imágenes, audio, vídeo… 
•Requiere permisos
En las profundidades 
Imagen: https://flic.kr/p/48XdaQ
PebbleSmartwatch 
•iOS & Android 
•APIs 
•SDK 
•Bluetooth!
Las cosas no siempre salen como esperamos 
Imagen: https://flic.kr/p/8bDAS1
Volvamos a la RaspberryPI 
•ARM 
•Linux 
•USB 
•Ethernet 
•Sensores
Volvamos a la RaspberryPI 
•ARM 
•Linux 
•USB 
•Ethernet 
•Sensores
Volvamos a la RaspberryPI 
•ARM 
•Linux 
•USB + Bluetooth 
•Ethernet 
•Sensores
Bluetooth IS EVIL 
•P2P 
•Alcance 
•Consumo 
•Servicios 
•Ancho de banda 
•Pairing, Búsqueda, Conexión
Servidor 
server_sock=BluetoothSocket( RFCOMM ) 
server_sock.bind(("",22)) 
server_sock.listen(22) 
client_sock, client_info= server_sock.accept() 
whileTrue: 
data = client_sock.recv(1024) 
client_sock.close() 
server_sock.close()
Servidor 
server_sock=BluetoothSocket( RFCOMM ) 
server_sock.bind(("",22)) 
server_sock.listen(22) 
client_sock, client_info= server_sock.accept() 
whileTrue: 
data = client_sock.recv(1024) 
client_sock.close() 
server_sock.close()
Servidor 
server_sock=BluetoothSocket( RFCOMM ) 
server_sock.bind(("",22)) 
server_sock.listen(22) 
client_sock, client_info= server_sock.accept() 
whileTrue: 
data = client_sock.recv(1024) 
client_sock.close() 
server_sock.close()
Cliente -Búsqueda 
chatServiceInfoCollection= 
awaitDeviceInformation.FindAllAsync( 
RfcommDeviceService.GetDeviceSelector( 
RfcommServiceId.SerialPort));
Cliente –Conexión 
varchatServiceInfo= chatServiceInfoCollection[0]; 
varservice= 
awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); 
awaitchatSocket.ConnectAsync( 
service.ConnectionHostName, 
service.ConnectionServiceName); 
varchatWriter= new DataWriter(chatSocket.OutputStream); 
varchatReader= new DataReader(chatSocket.InputStream);
Cliente –Conexión 
varchatServiceInfo= chatServiceInfoCollection[0]; 
varservice= 
awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); 
awaitchatSocket.ConnectAsync( 
service.ConnectionHostName, 
service.ConnectionServiceName); 
varchatWriter= new DataWriter(chatSocket.OutputStream); 
varchatReader= new DataReader(chatSocket.InputStream);
Cliente –Conexión 
varchatServiceInfo= chatServiceInfoCollection[0]; 
varservice= 
awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); 
awaitchatSocket.ConnectAsync( 
service.ConnectionHostName, 
service.ConnectionServiceName); 
varchatWriter= new DataWriter(chatSocket.OutputStream); 
varchatReader= new DataReader(chatSocket.InputStream);
Cliente –Envío y recepción 
chatWriter.WriteString("open"); 
awaitchatWriter.StoreAsync(); 
byte[] buffer = new byte[10]; 
awaitchatSocket.InputStream.ReadAsync( 
buffer.AsBuffer(), 10, 
InputStreamOptions.Partial); 
stringresult= System.Text.Encoding.UTF8.GetString(buffer, 0, 10);
Cliente –Envío y recepción 
chatWriter.WriteString("open"); 
awaitchatWriter.StoreAsync(); 
byte[] buffer = new byte[10]; 
awaitchatSocket.InputStream.ReadAsync( 
buffer.AsBuffer(), 10, 
InputStreamOptions.Partial); 
stringresult= System.Text.Encoding.UTF8.GetString(buffer, 0, 10);
Ejemplo completo 
DEMO 
C# 
Python 
Bluetooth Serial Port
Bluetooth IS STILL EVIL 
•P2P 
•Alcance 
•Consumo 
•Servicios 
•Ancho de banda 
•Pairing, Búsqueda, Conexión
Podemos comunicarnuestras apps con el mundo exterior
WebSockets, sockets, bluetooth, GPS, infrarrojos, sonido, NFC, sensores
Preguntas? Hay regalitos…
Gracias! Enlaces, código y slidesen rlbisbe.net 
roberto.luis@rlbisbe.net 
@rlbisbe

More Related Content

What's hot

Afrimadoni the power of docker
Afrimadoni   the power of dockerAfrimadoni   the power of docker
Afrimadoni the power of dockerPHP Indonesia
 
WebAssembly WASM Introduction Presentation
WebAssembly WASM Introduction PresentationWebAssembly WASM Introduction Presentation
WebAssembly WASM Introduction PresentationBrad Beiermann
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance OptimizationChen-Tien Tsai
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactChen-Tien Tsai
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its EvolutionDeepu S Nath
 
JS digest, March 2017
JS digest, March 2017JS digest, March 2017
JS digest, March 2017ElifTech
 
Open Source Flash 2010
Open Source Flash 2010Open Source Flash 2010
Open Source Flash 2010Gaurav Saxena
 
Web assembly - Future of the Web
Web assembly - Future of the WebWeb assembly - Future of the Web
Web assembly - Future of the WebCodeValue
 
Managing Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEXManaging Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEXKai Donato
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami SayarFITC
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.jsKasey McCurdy
 
JS digest. May 2017
JS digest. May 2017JS digest. May 2017
JS digest. May 2017ElifTech
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebBhagaban Behera
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJSJITENDRA KUMAR PATEL
 
MEAN Stack
MEAN StackMEAN Stack
MEAN StackDotitude
 

What's hot (20)

Afrimadoni the power of docker
Afrimadoni   the power of dockerAfrimadoni   the power of docker
Afrimadoni the power of docker
 
Build App with Nodejs - YWC Workshop
Build App with Nodejs - YWC WorkshopBuild App with Nodejs - YWC Workshop
Build App with Nodejs - YWC Workshop
 
WebAssembly WASM Introduction Presentation
WebAssembly WASM Introduction PresentationWebAssembly WASM Introduction Presentation
WebAssembly WASM Introduction Presentation
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + react
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its Evolution
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
 
JS digest, March 2017
JS digest, March 2017JS digest, March 2017
JS digest, March 2017
 
Open Source Flash 2010
Open Source Flash 2010Open Source Flash 2010
Open Source Flash 2010
 
Web assembly - Future of the Web
Web assembly - Future of the WebWeb assembly - Future of the Web
Web assembly - Future of the Web
 
Managing Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEXManaging Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEX
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami Sayar
 
Node.js for beginner
Node.js for beginnerNode.js for beginner
Node.js for beginner
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
JS digest. May 2017
JS digest. May 2017JS digest. May 2017
JS digest. May 2017
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime Web
 
Tech talk: PHP
Tech talk: PHPTech talk: PHP
Tech talk: PHP
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
 
CloudFoundry@home
CloudFoundry@homeCloudFoundry@home
CloudFoundry@home
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 

Viewers also liked

Windows 8 Universidad de Valencia
Windows 8 Universidad de ValenciaWindows 8 Universidad de Valencia
Windows 8 Universidad de ValenciaRoberto Luis Bisbé
 
Lecciones aprendidas creando una red social
Lecciones aprendidas creando una red socialLecciones aprendidas creando una red social
Lecciones aprendidas creando una red socialRoberto Luis Bisbé
 
Tres tecnologías Microsoft que no se dan en la carrera
Tres tecnologías Microsoft que no se dan en la carreraTres tecnologías Microsoft que no se dan en la carrera
Tres tecnologías Microsoft que no se dan en la carreraRoberto Luis Bisbé
 
Creando aplicaciones móviles con Windows 8 y Windows Phone 8
Creando aplicaciones móviles con Windows 8 y Windows Phone 8Creando aplicaciones móviles con Windows 8 y Windows Phone 8
Creando aplicaciones móviles con Windows 8 y Windows Phone 8Roberto Luis Bisbé
 
Windows 8 y Metro para desarrolladores .NET
Windows 8 y Metro para desarrolladores .NETWindows 8 y Metro para desarrolladores .NET
Windows 8 y Metro para desarrolladores .NETRoberto Luis Bisbé
 
Una visión multiplataforma con aspnet v next
Una visión multiplataforma con aspnet v nextUna visión multiplataforma con aspnet v next
Una visión multiplataforma con aspnet v nextEduard Tomàs
 
De escritorio a Javascript, nuestra experiencia desde las trincheras
De escritorio a Javascript, nuestra experiencia desde las trincherasDe escritorio a Javascript, nuestra experiencia desde las trincheras
De escritorio a Javascript, nuestra experiencia desde las trincherasRoberto Luis Bisbé
 
Javascript vuela en primera clase con Firefox OS
Javascript vuela en primera clase con Firefox OSJavascript vuela en primera clase con Firefox OS
Javascript vuela en primera clase con Firefox OSRoberto Luis Bisbé
 
DotNetSpain2015: Extendiendo Visual Studio Online a través de su API
DotNetSpain2015: Extendiendo Visual Studio Online a través de su APIDotNetSpain2015: Extendiendo Visual Studio Online a través de su API
DotNetSpain2015: Extendiendo Visual Studio Online a través de su APIRoberto Luis Bisbé
 

Viewers also liked (13)

Windows 8 Universidad de Valencia
Windows 8 Universidad de ValenciaWindows 8 Universidad de Valencia
Windows 8 Universidad de Valencia
 
Lecciones aprendidas creando una red social
Lecciones aprendidas creando una red socialLecciones aprendidas creando una red social
Lecciones aprendidas creando una red social
 
Tres tecnologías Microsoft que no se dan en la carrera
Tres tecnologías Microsoft que no se dan en la carreraTres tecnologías Microsoft que no se dan en la carrera
Tres tecnologías Microsoft que no se dan en la carrera
 
Creando aplicaciones móviles con Windows 8 y Windows Phone 8
Creando aplicaciones móviles con Windows 8 y Windows Phone 8Creando aplicaciones móviles con Windows 8 y Windows Phone 8
Creando aplicaciones móviles con Windows 8 y Windows Phone 8
 
Windows 8 y Metro para desarrolladores .NET
Windows 8 y Metro para desarrolladores .NETWindows 8 y Metro para desarrolladores .NET
Windows 8 y Metro para desarrolladores .NET
 
Windows phonesessions
Windows phonesessionsWindows phonesessions
Windows phonesessions
 
Una visión multiplataforma con aspnet v next
Una visión multiplataforma con aspnet v nextUna visión multiplataforma con aspnet v next
Una visión multiplataforma con aspnet v next
 
De escritorio a Javascript, nuestra experiencia desde las trincheras
De escritorio a Javascript, nuestra experiencia desde las trincherasDe escritorio a Javascript, nuestra experiencia desde las trincheras
De escritorio a Javascript, nuestra experiencia desde las trincheras
 
Javascript vuela en primera clase con Firefox OS
Javascript vuela en primera clase con Firefox OSJavascript vuela en primera clase con Firefox OS
Javascript vuela en primera clase con Firefox OS
 
DotNetSpain2015: Extendiendo Visual Studio Online a través de su API
DotNetSpain2015: Extendiendo Visual Studio Online a través de su APIDotNetSpain2015: Extendiendo Visual Studio Online a través de su API
DotNetSpain2015: Extendiendo Visual Studio Online a través de su API
 
Desarrollo Full Stack UAM.net
Desarrollo Full Stack UAM.netDesarrollo Full Stack UAM.net
Desarrollo Full Stack UAM.net
 
APIs REST
APIs RESTAPIs REST
APIs REST
 
Los lenguajes de la web
Los lenguajes de la webLos lenguajes de la web
Los lenguajes de la web
 

Similar to Comunicando nuestras apps con el mundo exterior

StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...Alexandre Brandão Lustosa
 
Matrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummitMatrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummitAlan Quayle
 
Building an ActionScript Game Server with over 15,000 Concurrent Connections
Building an ActionScript Game Server with over 15,000 Concurrent ConnectionsBuilding an ActionScript Game Server with over 15,000 Concurrent Connections
Building an ActionScript Game Server with over 15,000 Concurrent Connections Renaun Erickson
 
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015SenZations Summer School
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
WebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & ImplementationWebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & ImplementationAmir Zmora
 
MUM Middle East 2016 - System Integration Analyst
MUM Middle East 2016 - System Integration AnalystMUM Middle East 2016 - System Integration Analyst
MUM Middle East 2016 - System Integration AnalystFajar Nugroho
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1Mohammad Qureshi
 
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...mfrancis
 
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3Adam Dunkels
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
Jugando con websockets en nodeJS
Jugando con websockets en nodeJSJugando con websockets en nodeJS
Jugando con websockets en nodeJSIsrael Gutiérrez
 
Vert.X and MSA - DevOps
Vert.X and MSA - DevOpsVert.X and MSA - DevOps
Vert.X and MSA - DevOpsYongHyuk Lee
 

Similar to Comunicando nuestras apps con el mundo exterior (20)

signalr
signalrsignalr
signalr
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
 
Matrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummitMatrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummit
 
Building an ActionScript Game Server with over 15,000 Concurrent Connections
Building an ActionScript Game Server with over 15,000 Concurrent ConnectionsBuilding an ActionScript Game Server with over 15,000 Concurrent Connections
Building an ActionScript Game Server with over 15,000 Concurrent Connections
 
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
WebSocket
WebSocketWebSocket
WebSocket
 
WebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & ImplementationWebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & Implementation
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
MUM Middle East 2016 - System Integration Analyst
MUM Middle East 2016 - System Integration AnalystMUM Middle East 2016 - System Integration Analyst
MUM Middle East 2016 - System Integration Analyst
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
 
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...
 
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Jugando con websockets en nodeJS
Jugando con websockets en nodeJSJugando con websockets en nodeJS
Jugando con websockets en nodeJS
 
111214 node conf
111214 node conf111214 node conf
111214 node conf
 
Apache Libcloud
Apache LibcloudApache Libcloud
Apache Libcloud
 
Vert.X and MSA - DevOps
Vert.X and MSA - DevOpsVert.X and MSA - DevOps
Vert.X and MSA - DevOps
 

More from Roberto Luis Bisbé

More from Roberto Luis Bisbé (8)

Scala desde c# y JavaScript
Scala desde c# y JavaScriptScala desde c# y JavaScript
Scala desde c# y JavaScript
 
Desarrollo de aplicaciones para Windows 8 y Windows Phone
Desarrollo de aplicaciones para Windows 8 y Windows PhoneDesarrollo de aplicaciones para Windows 8 y Windows Phone
Desarrollo de aplicaciones para Windows 8 y Windows Phone
 
Desarrollo Metro con Windows 8 UPM
Desarrollo Metro con Windows 8 UPMDesarrollo Metro con Windows 8 UPM
Desarrollo Metro con Windows 8 UPM
 
Aplicaciones Metro para Windows 8
Aplicaciones Metro para Windows 8Aplicaciones Metro para Windows 8
Aplicaciones Metro para Windows 8
 
Hardcore PHP
Hardcore PHPHardcore PHP
Hardcore PHP
 
El patrón MVC
El patrón MVCEl patrón MVC
El patrón MVC
 
Social Media
Social MediaSocial Media
Social Media
 
Fundamentos de sitios web accesibles
Fundamentos de sitios web accesiblesFundamentos de sitios web accesibles
Fundamentos de sitios web accesibles
 

Recently uploaded

Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 

Recently uploaded (20)

Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 

Comunicando nuestras apps con el mundo exterior

  • 1. Comunicandonuestras appscon el mundo exterior Roberto Luis Bisbé rlbisbe.net @rlbisbe
  • 2. @rlbisbe •Ingeniero en Informática @ UAM •Desarrollador @ frontiers •WP, W8 & Android dev •rlbisbe.net
  • 7. .NET Compact Framework .NET Framework USB RemoteAPI
  • 10. RaspberryPI •ARM •Linux •USB •Ethernet •Sensores
  • 11. RaspberryPI •ARM •Linux •USB •Ethernet •Sensores
  • 14. ! Web Socket •SignalR •.NET •socket.io •node.js •Python •faye •ruby
  • 15. Qué es WebSocket •Bidireccional •HTTP •Soporte nativo en 8.x
  • 16. Servidor varserver = http.createServer(app) server.listen(1430) varwss= new WebSocketServer({ server: server }); wss.on("connection", function(ws) { ws.on("message", function(data) { ws.send("response"); }) ws.on("close", function() { //Closed }) }
  • 17. Servidor varserver = http.createServer(app) server.listen(1430) varwss= new WebSocketServer({ server: server }); wss.on("connection", function(ws) { ws.on("message", function(data) { ws.send("response"); }) ws.on("close", function() { //Closed }) }
  • 18. Servidor varserver = http.createServer(app) server.listen(1430) varwss= new WebSocketServer({ server: server }); wss.on("connection", function(ws) { ws.on("message", function(data) { ws.send("response"); }) ws.on("close", function() { //Closed }) }
  • 19. Cliente -Conexión varwebSocket= new MessageWebSocket(); webSocket.Control.MessageType= SocketMessageType.Utf8; webSocket.MessageReceived+= ProcessMessageReceived; webSocket.Closed+= Closed; awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
  • 20. Cliente -Conexión ver webSocket= new MessageWebSocket(); webSocket.Control.MessageType= SocketMessageType.Utf8; webSocket.MessageReceived+= ProcessMessageReceived; webSocket.Closed+= Closed; awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
  • 21. Cliente -Conexión ver webSocket= new MessageWebSocket(); webSocket.Control.MessageType= SocketMessageType.Utf8; webSocket.MessageReceived+= ProcessMessageReceived; webSocket.Closed+= Closed; awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
  • 22. Cliente -Conexión ver webSocket= new MessageWebSocket(); webSocket.Control.MessageType= SocketMessageType.Utf8; webSocket.MessageReceived+= ProcessMessageReceived; webSocket.Closed+= Closed; awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
  • 23. Cliente -Envío y recepción var_messageWriter= new DataWriter(webSocket.OutputStream); _messageWriter.WriteString(message); await_messageWriter.StoreAsync(); varstream = new StreamReader(args.GetDataStream().AsStreamForRead()); stringmessage= stream.ReadToEnd();
  • 24. Cliente -Envío y recepción var_messageWriter= new DataWriter(webSocket.OutputStream); _messageWriter.WriteString(message); await_messageWriter.StoreAsync(); varstream = new StreamReader(args.GetDataStream().AsStreamForRead()); stringmessage= stream.ReadToEnd();
  • 25. Ejemplo completo DEMO C# Node JS WebSocket
  • 26. WebSocket •Bidireccional •HTTP •Soporte nativo en 8.x
  • 27. Bajando de nivel Imagen: https://flic.kr/p/aKN6u6
  • 28. StreamSockets •Flujo de datos sobre TCP •Texto, imágenes, audio, vídeo… •Permisos
  • 29. Servidor -Conexión varlistenSocket= new StreamSocketListener(); listenSocket.ConnectionReceived+= ConnectionReceived; awaitlistenSocket.BindServiceNameAsync("5000");
  • 30. Servidor -Recepción DataReaderreader= new DataReader(connectionSocket.InputStream); uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); if(sizeFieldCount!= sizeof(long)) return; uintresultLength= (uint)reader.ReadInt32(); uintactualResultLength= awaitreader.LoadAsync(resultLength); if(resultLength!= actualResultLength) return; varbyteResult= new byte[resultLength]; reader.ReadBytes(byteResult);
  • 31. Servidor -Recepción DataReaderreader= new DataReader(connectionSocket.InputStream); uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); if(sizeFieldCount!= sizeof(long)) return; uintresultLength= (uint)reader.ReadInt32(); uintactualResultLength= awaitreader.LoadAsync(resultLength); if(resultLength!= actualResultLength) return; varbyteResult= new byte[resultLength]; reader.ReadBytes(byteResult);
  • 32. Servidor -Recepción uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); if(sizeFieldCount!= sizeof(long)) return; uintresultLength= (uint)reader.ReadInt32(); uintactualResultLength= awaitreader.LoadAsync(resultLength); if(resultLength!= actualResultLength) return; varbyteResult= new byte[resultLength]; reader.ReadBytes(byteResult);
  • 33. Cliente -Conexión varconnectionSocket= new StreamSocket(); varserverHost= new HostName(server); awaitconnectionSocket.ConnectAsync(serverHost, port);
  • 34. Cliente -Envío varwriter= new DataWriter(connectionSocket.OutputStream); writer.WriteInt32(bytes.Length); writer.WriteBytes(bytes); awaitwriter.StoreAsync(); writer.DetachStream();
  • 35. Cliente -Envío varwriter= new DataWriter(connectionSocket.OutputStream); writer.WriteInt32(bytes.Length); writer.WriteBytes(bytes); awaitwriter.StoreAsync(); writer.DetachStream();
  • 36. Cliente -Envío varwriter= new DataWriter(connectionSocket.OutputStream); writer.WriteInt32(bytes.Length); writer.WriteBytes(bytes); awaitwriter.StoreAsync(); writer.DetachStream();
  • 37. Ejemplo completo DEMO WinRTC# WinRTC# Socket
  • 38. StreamSockets •Flujo de datos sobre TCP •Texto, imágenes, audio, vídeo… •Requiere permisos
  • 39. En las profundidades Imagen: https://flic.kr/p/48XdaQ
  • 40. PebbleSmartwatch •iOS & Android •APIs •SDK •Bluetooth!
  • 41. Las cosas no siempre salen como esperamos Imagen: https://flic.kr/p/8bDAS1
  • 42. Volvamos a la RaspberryPI •ARM •Linux •USB •Ethernet •Sensores
  • 43. Volvamos a la RaspberryPI •ARM •Linux •USB •Ethernet •Sensores
  • 44. Volvamos a la RaspberryPI •ARM •Linux •USB + Bluetooth •Ethernet •Sensores
  • 45. Bluetooth IS EVIL •P2P •Alcance •Consumo •Servicios •Ancho de banda •Pairing, Búsqueda, Conexión
  • 46. Servidor server_sock=BluetoothSocket( RFCOMM ) server_sock.bind(("",22)) server_sock.listen(22) client_sock, client_info= server_sock.accept() whileTrue: data = client_sock.recv(1024) client_sock.close() server_sock.close()
  • 47. Servidor server_sock=BluetoothSocket( RFCOMM ) server_sock.bind(("",22)) server_sock.listen(22) client_sock, client_info= server_sock.accept() whileTrue: data = client_sock.recv(1024) client_sock.close() server_sock.close()
  • 48. Servidor server_sock=BluetoothSocket( RFCOMM ) server_sock.bind(("",22)) server_sock.listen(22) client_sock, client_info= server_sock.accept() whileTrue: data = client_sock.recv(1024) client_sock.close() server_sock.close()
  • 49. Cliente -Búsqueda chatServiceInfoCollection= awaitDeviceInformation.FindAllAsync( RfcommDeviceService.GetDeviceSelector( RfcommServiceId.SerialPort));
  • 50. Cliente –Conexión varchatServiceInfo= chatServiceInfoCollection[0]; varservice= awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); awaitchatSocket.ConnectAsync( service.ConnectionHostName, service.ConnectionServiceName); varchatWriter= new DataWriter(chatSocket.OutputStream); varchatReader= new DataReader(chatSocket.InputStream);
  • 51. Cliente –Conexión varchatServiceInfo= chatServiceInfoCollection[0]; varservice= awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); awaitchatSocket.ConnectAsync( service.ConnectionHostName, service.ConnectionServiceName); varchatWriter= new DataWriter(chatSocket.OutputStream); varchatReader= new DataReader(chatSocket.InputStream);
  • 52. Cliente –Conexión varchatServiceInfo= chatServiceInfoCollection[0]; varservice= awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); awaitchatSocket.ConnectAsync( service.ConnectionHostName, service.ConnectionServiceName); varchatWriter= new DataWriter(chatSocket.OutputStream); varchatReader= new DataReader(chatSocket.InputStream);
  • 53. Cliente –Envío y recepción chatWriter.WriteString("open"); awaitchatWriter.StoreAsync(); byte[] buffer = new byte[10]; awaitchatSocket.InputStream.ReadAsync( buffer.AsBuffer(), 10, InputStreamOptions.Partial); stringresult= System.Text.Encoding.UTF8.GetString(buffer, 0, 10);
  • 54. Cliente –Envío y recepción chatWriter.WriteString("open"); awaitchatWriter.StoreAsync(); byte[] buffer = new byte[10]; awaitchatSocket.InputStream.ReadAsync( buffer.AsBuffer(), 10, InputStreamOptions.Partial); stringresult= System.Text.Encoding.UTF8.GetString(buffer, 0, 10);
  • 55. Ejemplo completo DEMO C# Python Bluetooth Serial Port
  • 56. Bluetooth IS STILL EVIL •P2P •Alcance •Consumo •Servicios •Ancho de banda •Pairing, Búsqueda, Conexión
  • 57. Podemos comunicarnuestras apps con el mundo exterior
  • 58. WebSockets, sockets, bluetooth, GPS, infrarrojos, sonido, NFC, sensores
  • 60. Gracias! Enlaces, código y slidesen rlbisbe.net roberto.luis@rlbisbe.net @rlbisbe