Mais conteúdo relacionado
Semelhante a Abusing phones to make the internet of things - FOSSASIA 2015 (20)
Mais de Jan Jongboom (20)
Abusing phones to make the internet of things - FOSSASIA 2015
- 13. Firefox OS without UI,
with extra low level APIs
So what is JanOS?
(and some kernel changes)
- 42. Hello world
1. Clone repo
2. Create JS file with some code
3. Add the JS file to index.html
https://github.com/jan-os/janos
- 43. 1 var conn = navigator.mozMobileConnections[0];
2 conn.addEventListener('voicechange', function vc() {
3 if (conn.voice.connected) {
4 conn.removeEventListener('voicechange', vc);
5
6 var req = navigator.mozMobileMessage
7 .send('+31612345678', 'Hello from JanOS!');
8 req.onsuccess = function() {
9 console.log('Message sent successfully');
10 };
11 req.onerror = function() {
12 console.error('Could not send SMS', req.error);
13 };
14 }
15 });
- 44. 1 var conn = navigator.mozMobileConnections[0];
2 conn.addEventListener('voicechange', function vc() {
3 if (conn.voice.connected) {
4 conn.removeEventListener('voicechange', vc);
5
6 var req = navigator.mozMobileMessage
7 .send('+31612345678', 'Hello from JanOS!');
8 req.onsuccess = function() {
9 console.log('Message sent successfully');
10 };
11 req.onerror = function() {
12 console.error('Could not send SMS', req.error);
13 };
14 }
15 });
- 45. 1 var conn = navigator.mozMobileConnections[0];
2 conn.addEventListener('voicechange', function vc() {
3 if (conn.voice.connected) {
4 conn.removeEventListener('voicechange', vc);
5
6 var req = navigator.mozMobileMessage
7 .send('+31612345678', 'Hello from JanOS!');
8 req.onsuccess = function() {
9 console.log('Message sent successfully');
10 };
11 req.onerror = function() {
12 console.error('Could not send SMS', req.error);
13 };
14 }
15 });
- 46. 1 var conn = navigator.mozMobileConnections[0];
2 conn.addEventListener('voicechange', function vc() {
3 if (conn.voice.connected) {
4 conn.removeEventListener('voicechange', vc);
5
6 var req = navigator.mozMobileMessage
7 .send('+31612345678', 'Hello from JanOS!');
8 req.onsuccess = function() {
9 console.log('Message sent successfully');
10 };
11 req.onerror = function() {
12 console.error('Could not send SMS', req.error);
13 };
14 }
15 });
- 47. 1 var conn = navigator.mozMobileConnections[0];
2 conn.addEventListener('voicechange', function vc() {
3 if (conn.voice.connected) {
4 conn.removeEventListener('voicechange', vc);
5
6 var req = navigator.mozMobileMessage
7 .send('+31612345678', 'Hello from JanOS!');
8 req.onsuccess = function() {
9 console.log('Message sent successfully');
10 };
11 req.onerror = function() {
12 console.error('Could not send SMS', req.error);
13 };
14 }
15 });