OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'dart:fletch'; | 5 import 'dart:dartino'; |
6 import 'dart:fletch.ffi'; | 6 import 'dart:dartino.ffi'; |
7 import 'package:ffi/ffi.dart'; | 7 import 'package:ffi/ffi.dart'; |
8 | 8 |
9 // MQTT success value | 9 // MQTT success value |
10 const int MQTTCLIENT_SUCCESS = 0; | 10 const int MQTTCLIENT_SUCCESS = 0; |
11 | 11 |
12 // Foreign functions from the native Paho library | 12 // Foreign functions from the native Paho library |
13 final ForeignLibrary _mqttLib = new | 13 final ForeignLibrary _mqttLib = new |
14 ForeignLibrary.fromName(ForeignLibrary.bundleLibraryName('paho-mqtt3c')); | 14 ForeignLibrary.fromName(ForeignLibrary.bundleLibraryName('paho-mqtt3c')); |
15 final ForeignFunction _MQTTClient_create = | 15 final ForeignFunction _MQTTClient_create = |
16 _mqttLib.lookup('MQTTClient_create'); | 16 _mqttLib.lookup('MQTTClient_create'); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 switch (wordSize) { | 249 switch (wordSize) { |
250 case 4: | 250 case 4: |
251 setInt32(offsets[0], value); | 251 setInt32(offsets[0], value); |
252 case 8: | 252 case 8: |
253 setInt32(offsets[1], value); | 253 setInt32(offsets[1], value); |
254 default: | 254 default: |
255 throw "IndexedStruct: Unsupported machine word size."; | 255 throw "IndexedStruct: Unsupported machine word size."; |
256 } | 256 } |
257 } | 257 } |
258 } | 258 } |
OLD | NEW |