rhodes 2.3.0 → 2.3.1.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/Manifest.txt +5819 -0
- data/README.md +2 -2
- data/Rakefile +9 -5
- data/doc/build.txt +7 -13
- data/doc/configuration.txt +4 -0
- data/doc/connect-to-web-services.txt +0 -1
- data/doc/device-caps.txt +2 -2
- data/doc/extensions.txt +2 -0
- data/doc/linea.txt +699 -0
- data/doc/rhom.txt +2 -1
- data/doc/synchronization.txt +39 -2
- data/doc/ui.txt +1 -0
- data/installer/README.html +1 -1
- data/lib/build/jake.rb +3 -0
- data/lib/framework/res/esri.wm.png +0 -0
- data/lib/framework/rho/render.rb +2 -0
- data/lib/framework/rho/rho.rb +17 -10
- data/lib/framework/rho/rhoapplication.rb +13 -3
- data/lib/framework/rho/rhoevent_bb.rb +3 -1
- data/lib/framework/rho/rhoevent_c.rb +4 -1
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhom/rhom.rb +10 -0
- data/lib/framework/rhom/rhom_object_factory.rb +45 -0
- data/lib/framework/rhom/rhom_source.rb +1 -1
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +2 -2
- data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +1 -1
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +1 -1
- data/platform/android/Rhodes/jni/src/callbacks.cpp +9 -11
- data/platform/android/Rhodes/jni/src/event.cpp +17 -9
- data/platform/android/Rhodes/jni/src/mapview.cpp +34 -4
- data/platform/android/Rhodes/jni/src/rhodes.cpp +1 -1
- data/platform/android/Rhodes/res/drawable/esri.png +0 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +3 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +8 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +80 -9
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +29 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +4 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +50 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +3 -0
- data/platform/android/build/android.rake +45 -23
- data/platform/android/build/librhocommon_build.files +1 -0
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +6 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/CachedDataRow.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/CachedRow.java +3 -2
- data/platform/bb/Hsqldb/src/org/hsqldb/Row.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/CachedObject.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/DataFileCache.java +66 -16
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/RhoCrypto.java +116 -0
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +39 -2
- data/platform/bb/RubyVM/src/com/rho/Tokenizer.java +11 -6
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +157 -150
- data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +15 -0
- data/platform/bb/RubyVM/src/com/rho/net/AsyncHttp.java +35 -23
- data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +6 -9
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +54 -16
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +18 -9
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +37 -59
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +3 -0
- data/platform/bb/build/RubyVM_build.files +1 -0
- data/platform/bb/build/bb.rake +4 -5
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +4 -1
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +8 -3
- data/platform/bb/rhodes/resources/esri.png +0 -0
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +2 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +8 -3
- data/platform/bb/rhodes/src/com/rho/rubyext/RhoCalendar.java +4 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +2 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +9 -0
- data/platform/iphone/Classes/Event/Event.m +12 -2
- data/platform/iphone/Classes/NativeBar.h +12 -11
- data/platform/iphone/Classes/NativeBar.m +13 -3
- data/platform/iphone/Classes/Rhodes.m +48 -10
- data/platform/iphone/Classes/SimpleMainView.h +1 -0
- data/platform/iphone/Classes/SimpleMainView.m +7 -1
- data/platform/iphone/Classes/SplitView/LeftViewController.m +3 -0
- data/platform/iphone/Classes/SplitView/RightViewController.m +11 -6
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +8 -0
- data/platform/iphone/Classes/TabbedMainView.m +39 -3
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +4 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +3 -3
- data/platform/shared/SyncClient/SyncClient.cpp +23 -23
- data/platform/shared/common/IRhoClassFactory.h +6 -4
- data/platform/shared/common/RhoAppAdapter.h +1 -1
- data/platform/shared/common/RhoFile.cpp +10 -0
- data/platform/shared/common/RhoFile.h +1 -0
- data/platform/shared/common/RhoMutexLock.h +1 -1
- data/platform/shared/common/RhoStd.h +5 -0
- data/platform/shared/common/RhoThread.cpp +2 -2
- data/platform/shared/common/RhoThread.h +1 -2
- data/platform/shared/common/RhodesApp.cpp +33 -55
- data/platform/shared/common/RhodesApp.h +0 -5
- data/platform/shared/common/RhodesAppBase.cpp +1 -1
- data/platform/shared/common/SplashScreen.cpp +1 -2
- data/platform/shared/common/ThreadQueue.cpp +31 -4
- data/platform/shared/common/ThreadQueue.h +10 -3
- data/platform/shared/common/Tokenizer.cpp +12 -8
- data/platform/shared/common/iphone/RhoClassFactory.cpp +5 -8
- data/platform/shared/common/iphone/RhoClassfactory.h +1 -1
- data/platform/shared/common/map/ESRIMapEngine.cpp +17 -7
- data/platform/shared/common/map/ESRIMapEngine.h +11 -1
- data/platform/shared/common/map/GoogleMapEngine.cpp +3 -3
- data/platform/shared/common/map/GoogleMapEngine.h +2 -2
- data/platform/shared/common/map/MapEngine.cpp +37 -0
- data/platform/shared/common/map/MapEngine.h +5 -0
- data/platform/shared/db/DBAdapter.cpp +113 -81
- data/platform/shared/db/DBAdapter.h +21 -5
- data/platform/shared/db/DBAttrManager.cpp +2 -2
- data/platform/shared/db/DBResult.h +28 -0
- data/platform/shared/net/AsyncHttp.cpp +48 -48
- data/platform/shared/net/AsyncHttp.h +15 -12
- data/platform/shared/net/CURLNetRequest.cpp +27 -105
- data/platform/shared/net/CURLNetRequest.h +8 -15
- data/platform/shared/net/INetRequest.cpp +122 -0
- data/platform/shared/net/INetRequest.h +96 -23
- data/platform/shared/net/ssl.cpp +1 -1
- data/platform/shared/ruby/ext/calendar/calendar.i +2 -2
- data/platform/shared/ruby/ext/calendar/calendar_wrap.c +30 -3
- data/platform/shared/rubyext/GeoLocation.cpp +4 -5
- data/platform/shared/rubyext/GeoLocation.h +4 -4
- data/platform/shared/rubyext/RhoAppAdapter.cpp +1 -1
- data/platform/shared/rubyext/System.cpp +3 -0
- data/platform/shared/sync/ClientRegister.cpp +6 -9
- data/platform/shared/sync/ClientRegister.h +8 -6
- data/platform/shared/sync/SyncEngine.cpp +54 -30
- data/platform/shared/sync/SyncEngine.h +9 -11
- data/platform/shared/sync/SyncNotify.cpp +19 -14
- data/platform/shared/sync/SyncNotify.h +5 -12
- data/platform/shared/sync/SyncSource.cpp +53 -76
- data/platform/shared/sync/SyncSource.h +5 -4
- data/platform/shared/sync/SyncThread.cpp +5 -7
- data/platform/shared/sync/SyncThread.h +2 -2
- data/platform/wm/RhoLib/RhoLib.vcproj +43 -39
- data/platform/wm/build/wm.rake +19 -17
- data/platform/wm/rhodes/AppManager.cpp +4 -4
- data/platform/wm/rhodes/MainWindow.cpp +0 -1
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +4 -0
- data/platform/wm/rhodes/Vibrate.cpp +2 -2
- data/platform/wm/rhodes/Vibrate.h +1 -1
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +7 -5
- data/platform/wm/rhodes/rho/common/RhoClassFactory.h +3 -3
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +24 -10
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +49 -25
- data/platform/wm/rhodes/rho/rubyext/calendar.cpp +16 -2
- data/platform/wm/rhodes/rhodes.vcproj +77 -85
- data/platform/wm/tools/detool/detool.cpp +16 -6
- data/rakefile.rb +9 -5
- data/res/build-tools/detool.exe +0 -0
- data/rhodes.gemspec +2 -2
- data/spec/phone_spec/app/spec/blobsync_spec.rb +1 -0
- data/spec/phone_spec/app/spec/events_spec.rb +13 -2
- data/spec/phone_spec/app/spec/mapview_spec.rb +2 -2
- data/spec/phone_spec/app/spec/nativebar_spec.rb +3 -3
- data/spec/phone_spec/app/spec/navbar_spec.rb +3 -3
- data/spec/phone_spec/app/spec/rho_spec.rb +1 -1
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +1 -1
- data/spec/phone_spec/app/spec/syncengine_spec.rb +219 -0
- data/spec/phone_spec/build.yml +1 -0
- metadata +15 -8
- data/platform/wm/rhodes/rho/net/NetRequest.cpp +0 -89
- data/platform/wm/rhodes/rho/net/NetRequest.h +0 -45
data/doc/linea.txt
ADDED
@@ -0,0 +1,699 @@
|
|
1
|
+
# LineaSDK as native extension in RHodes applications
|
2
|
+
|
3
|
+
## Definition
|
4
|
+
LineaSDK Ruby interface provide access to Linea device from Ruby code in Rhodes application.
|
5
|
+
Before using it please read the original LineaSDK documentation and see Linea objective-C API, because current API is very similar to objective-C API.
|
6
|
+
|
7
|
+
All constants and methods have the same name and practically the same results/parameters (with little Ruby specific)
|
8
|
+
All method can raise Ruby exception like methods of Linea objective-C class
|
9
|
+
|
10
|
+
We use HASH instead of structure.
|
11
|
+
|
12
|
+
Instead of special delegate class (in objective-C interface) we use callback mechanism for any feedback from device. if you want listen events from Line device - make Ruby function in your controller and post his url to addDelegate() function after it you will receive events from device in your controller's function. All events receive in one callback function, use @params['delegateEvent'] for detect type of event. See more detail in description of addDelegate(url) of Line class (below).
|
13
|
+
|
14
|
+
## Linea API
|
15
|
+
|
16
|
+
Ruby interface located in [https://github.com/rhomobile/linea-rhodes/blob/master/extensions/linea/linea.rb linea.rb]
|
17
|
+
|
18
|
+
:::ruby
|
19
|
+
#
|
20
|
+
# Ruby interface of LineaSDK.
|
21
|
+
# see LineaSDK.h and Linea documentation for details
|
22
|
+
# This main class Linea have the very simiilar interface with main Linea class in objective-C LineaSDK
|
23
|
+
# All constants and methods have the same name and practically the same results/parameters (with little Ruby specific)
|
24
|
+
# All method can raise Ruby exception like methods of Linea objective-C class
|
25
|
+
#
|
26
|
+
|
27
|
+
|
28
|
+
class Linea
|
29
|
+
|
30
|
+
|
31
|
+
# BARCODES
|
32
|
+
BAR_ALL = 0
|
33
|
+
BAR_UPC = 1
|
34
|
+
BAR_CODABAR = 2
|
35
|
+
BAR_CODE25_NI2OF5 = 3
|
36
|
+
BAR_CODE25_I2OF5 = 4
|
37
|
+
BAR_CODE39 = 5
|
38
|
+
BAR_CODE93 = 6
|
39
|
+
BAR_CODE128 = 7
|
40
|
+
BAR_CODE11 = 8
|
41
|
+
BAR_CPCBINARY = 9
|
42
|
+
BAR_DUN14 = 10
|
43
|
+
BAR_EAN2 = 11
|
44
|
+
BAR_EAN5 = 12
|
45
|
+
BAR_EAN8 = 13
|
46
|
+
BAR_EAN13 = 14
|
47
|
+
BAR_EAN128 =15
|
48
|
+
BAR_GS1DATABAR =16
|
49
|
+
BAR_ITF14 = 17
|
50
|
+
BAR_LATENT_IMAGE = 18
|
51
|
+
BAR_PHARMACODE = 19
|
52
|
+
BAR_PLANET = 20
|
53
|
+
BAR_POSTNET = 21
|
54
|
+
BAR_INTELLIGENT_MAIL = 22
|
55
|
+
BAR_MSI = 23
|
56
|
+
BAR_POSTBAR = 24
|
57
|
+
BAR_RM4SCC = 25
|
58
|
+
BAR_TELEPEN = 26
|
59
|
+
BAR_PLESSEY = 27
|
60
|
+
BAR_PDF417 = 28
|
61
|
+
BAR_MICROPDF417 = 29
|
62
|
+
BAR_DATAMATRIX = 30
|
63
|
+
BAR_AZTEK = 31
|
64
|
+
BAR_QRCODE = 32
|
65
|
+
BAR_MAXICODE = 33
|
66
|
+
BAR_LAST = 34
|
67
|
+
|
68
|
+
# BARCODES_EX
|
69
|
+
BAR_EX_ALL = 0
|
70
|
+
BAR_EX_UPCA = 1
|
71
|
+
BAR_EX_CODABAR = 2
|
72
|
+
BAR_EX_CODE25_NI2OF5 = 3
|
73
|
+
BAR_EX_CODE25_I2OF5 = 4
|
74
|
+
BAR_EX_CODE39 = 5
|
75
|
+
BAR_EX_CODE93 = 6
|
76
|
+
BAR_EX_CODE128 = 7
|
77
|
+
BAR_EX_CODE11 = 8
|
78
|
+
BAR_EX_CPCBINARY = 9
|
79
|
+
BAR_EX_DUN14 = 10
|
80
|
+
BAR_EX_EAN2 = 11
|
81
|
+
BAR_EX_EAN5 = 12
|
82
|
+
BAR_EX_EAN8 = 13
|
83
|
+
BAR_EX_EAN13 = 14
|
84
|
+
BAR_EX_EAN128 = 15
|
85
|
+
BAR_EX_GS1DATABAR = 16
|
86
|
+
BAR_EX_ITF14 = 17
|
87
|
+
BAR_EX_LATENT_IMAGE = 18
|
88
|
+
BAR_EX_PHARMACODE = 19
|
89
|
+
BAR_EX_PLANET = 20
|
90
|
+
BAR_EX_POSTNET = 21
|
91
|
+
BAR_EX_INTELLIGENT_MAIL = 22
|
92
|
+
BAR_EX_MSI_PLESSEY = 23
|
93
|
+
BAR_EX_POSTBAR = 24
|
94
|
+
BAR_EX_RM4SCC = 25
|
95
|
+
BAR_EX_TELEPEN = 26
|
96
|
+
BAR_EX_UK_PLESSEY = 27
|
97
|
+
BAR_EX_PDF417 = 28
|
98
|
+
BAR_EX_MICROPDF417 = 29
|
99
|
+
BAR_EX_DATAMATRIX = 30
|
100
|
+
BAR_EX_AZTEK = 31
|
101
|
+
BAR_EX_QRCODE = 32
|
102
|
+
BAR_EX_MAXICODE = 33
|
103
|
+
BAR_EX_RESERVED1 = 34
|
104
|
+
BAR_EX_RESERVED2 = 35
|
105
|
+
BAR_EX_RESERVED3 = 36
|
106
|
+
BAR_EX_RESERVED4 = 37
|
107
|
+
BAR_EX_RESERVED5 = 38
|
108
|
+
BAR_EX_UPCA_2 = 39
|
109
|
+
BAR_EX_UPCA_5 = 40
|
110
|
+
BAR_EX_UPCE = 41
|
111
|
+
BAR_EX_UPCE_2 = 42
|
112
|
+
BAR_EX_UPCE_5 = 43
|
113
|
+
BAR_EX_EAN13_2 = 44
|
114
|
+
BAR_EX_EAN13_5 = 45
|
115
|
+
BAR_EX_EAN8_2 = 46
|
116
|
+
BAR_EX_EAN8_5 = 47
|
117
|
+
BAR_EX_CODE39_FULL = 48
|
118
|
+
BAR_EX_ITA_PHARMA = 49
|
119
|
+
BAR_EX_CODABAR_ABC = 50
|
120
|
+
BAR_EX_CODABAR_CX = 51
|
121
|
+
BAR_EX_SCODE = 52
|
122
|
+
BAR_EX_MATRIX_2OF5 = 53
|
123
|
+
BAR_EX_IATA = 54
|
124
|
+
BAR_EX_KOREAN_POSTAL = 55
|
125
|
+
BAR_EX_CCA = 56
|
126
|
+
BAR_EX_CCB = 57
|
127
|
+
BAR_EX_CCC = 58
|
128
|
+
BAR_EX_LAST = 59
|
129
|
+
|
130
|
+
# CONN_STATES
|
131
|
+
CONN_DISCONNECTED = 0
|
132
|
+
CONN_CONNECTING = 1
|
133
|
+
CONN_CONNECTED = 2
|
134
|
+
|
135
|
+
# SCAN_MODES
|
136
|
+
MODE_SINGLE_SCAN = 0
|
137
|
+
MODE_MULTI_SCAN = 1
|
138
|
+
|
139
|
+
# BUTTON_STATES
|
140
|
+
BUTTON_DISABLED = 0
|
141
|
+
BUTTON_ENABLED = 1
|
142
|
+
|
143
|
+
# MS_MODES
|
144
|
+
MS_PROCESSED_CARD_DATA = 0
|
145
|
+
MS_RAW_CARD_DATA = 1
|
146
|
+
|
147
|
+
# BT_MODES
|
148
|
+
BARCODE_TYPE_DEFAULT = 0
|
149
|
+
BARCODE_TYPE_EXTENDED = 1
|
150
|
+
|
151
|
+
|
152
|
+
# Printer types
|
153
|
+
PRINTER_PP50 = 0
|
154
|
+
PRINTER_PP55 = 1
|
155
|
+
PRINTER_CMP10 = 2
|
156
|
+
PRINTER_DPP350 = 3
|
157
|
+
PRINTER_DPP250 = 4
|
158
|
+
PRINTER_PP60 = 5
|
159
|
+
|
160
|
+
# Data channels
|
161
|
+
CHANNEL_PRN = 1
|
162
|
+
CHANNEL_SMARTCARD = 2
|
163
|
+
CHANNEL_GPRS = 5
|
164
|
+
CHANNEL_MIFARE = 16
|
165
|
+
|
166
|
+
# Print aligning
|
167
|
+
ALIGN_LEFT = 0
|
168
|
+
ALIGN_CENTER = 1
|
169
|
+
ALIGN_RIGHT = 2
|
170
|
+
|
171
|
+
# BARCODE MODULE SPECIFIC CONSTANTS
|
172
|
+
# Barcode Printing Types
|
173
|
+
# Prints UPC-A barcode
|
174
|
+
BAR_PRN_UPCA = 0
|
175
|
+
# Prints UPC-E barcode
|
176
|
+
BAR_PRN_UPCE = 1
|
177
|
+
# Prints EAN-13 barcode
|
178
|
+
BAR_PRN_EAN13 = 2
|
179
|
+
# Prints EAN-8 barcode
|
180
|
+
BAR_PRN_EAN8 = 3
|
181
|
+
# Prints CODE39 barcode
|
182
|
+
BAR_PRN_CODE39 = 4
|
183
|
+
# Prints ITF barcode
|
184
|
+
BAR_PRN_ITF = 5
|
185
|
+
# Prints CODABAR barcode
|
186
|
+
BAR_PRN_CODABAR = 6
|
187
|
+
# Prints CODE93 barcode
|
188
|
+
BAR_PRN_CODE93 = 7
|
189
|
+
# Prints CODE128 barcode
|
190
|
+
BAR_PRN_CODE128 = 8
|
191
|
+
# Prints 2D PDF-417 barcode
|
192
|
+
BAR_PRN_PDF417 = 9
|
193
|
+
# Prints CODE128 optimized barcode. Supported only on PP-60, DPP-350 and DPP-250 printers, it makes the barcode lot smaller especially when numbers only are used
|
194
|
+
BAR_PRN_CODE128AUTO = 10
|
195
|
+
# Prints EAN128 optimized barcode. Supported only on PP-60, DPP-350 and DPP-250 printers, it makes the barcode lot smaller especially when numbers only are used
|
196
|
+
BAR_PRN_EAN128AUTO = 11
|
197
|
+
|
198
|
+
# Barcode Text Positopn
|
199
|
+
BAR_TEXT_NONE = 0
|
200
|
+
BAR_TEXT_ABOVE = 1
|
201
|
+
BAR_TEXT_BELOW = 2
|
202
|
+
BAR_TEXT_BOTH = 3
|
203
|
+
|
204
|
+
# Intensity Levels
|
205
|
+
INTENSITY70 = 0
|
206
|
+
INTENSITY80 = 1
|
207
|
+
INTENSITY90 = 2
|
208
|
+
INTENSITY100 = 3
|
209
|
+
INTENSITY120 = 4
|
210
|
+
INTENSITY150 = 5
|
211
|
+
|
212
|
+
# Font Sizes
|
213
|
+
FONT_9X16 = 0
|
214
|
+
FONT_18X16 = 1
|
215
|
+
FONT_9X32 = 2
|
216
|
+
FONT_18X32 = 3
|
217
|
+
FONT_12X24 = 4
|
218
|
+
FONT_24X24 = 5
|
219
|
+
FONT_12X48 = 6
|
220
|
+
FONT_24X48 = 7
|
221
|
+
FONT_DEFAULT = FONT_12X24
|
222
|
+
|
223
|
+
# Font Styles
|
224
|
+
FONT_PLAIN = 0
|
225
|
+
FONT_BOLD = 1
|
226
|
+
FONT_ITALIC = 2
|
227
|
+
FONT_UNDERLINE = 4
|
228
|
+
FONT_INVERSE = 8
|
229
|
+
|
230
|
+
|
231
|
+
# ResetDefaults Flags
|
232
|
+
RESET_PRINTSETTINGS = 1
|
233
|
+
RESET_FONTSETTINGS = 2
|
234
|
+
RESET_BARCODESETTINGS = 4
|
235
|
+
RESET_DONTSETPRINTER = 128
|
236
|
+
|
237
|
+
# Align Flags
|
238
|
+
ALIGN_LEFT = 0
|
239
|
+
ALIGN_CENTER = 1
|
240
|
+
ALIGN_RIGHT = 2
|
241
|
+
TEXT_WORDWRAP = 1
|
242
|
+
|
243
|
+
TEXT_ROTATE_0 = 0
|
244
|
+
TEXT_ROTATE_90 = 1
|
245
|
+
TEXT_ROTATE_180 = 2
|
246
|
+
|
247
|
+
LINESPACE_DEFAULT = 34
|
248
|
+
|
249
|
+
BLACKMARK_TRESHOLD_DEFAULT = 104
|
250
|
+
|
251
|
+
# Encryptions
|
252
|
+
ALG_AES256 = 0
|
253
|
+
|
254
|
+
# Encryptions
|
255
|
+
# Authentication key
|
256
|
+
KEY_AUTHENTICATION = 0
|
257
|
+
# Encryption key, if set magnetic card data will be encrypted
|
258
|
+
KEY_ENCRYPTION = 1
|
259
|
+
|
260
|
+
# Creates and initializes new Linea class instance or returns already initalized one. Use this function, if you want to \
|
261
|
+
# access Linea from multiple classes
|
262
|
+
# return instance of Linea device class (Linea)
|
263
|
+
def self.sharedDevice
|
264
|
+
if $our_line_object == nil
|
265
|
+
$our_line_object = Linea.new
|
266
|
+
end
|
267
|
+
return $our_line_object
|
268
|
+
end
|
269
|
+
# get current connection state
|
270
|
+
# return int
|
271
|
+
def get_connstate
|
272
|
+
end
|
273
|
+
|
274
|
+
# get Linea device name
|
275
|
+
# return string
|
276
|
+
def get_deviceName
|
277
|
+
end
|
278
|
+
|
279
|
+
# get Linea device model
|
280
|
+
# return string
|
281
|
+
def get_deviceModel
|
282
|
+
end
|
283
|
+
|
284
|
+
# get firmware revision
|
285
|
+
# return string
|
286
|
+
def get_firmwareRevision
|
287
|
+
end
|
288
|
+
|
289
|
+
# get hardware revision
|
290
|
+
# return string
|
291
|
+
def get_hardwareRevision
|
292
|
+
end
|
293
|
+
|
294
|
+
# get serial number
|
295
|
+
# return string
|
296
|
+
def get_serialNumber
|
297
|
+
end
|
298
|
+
|
299
|
+
# Instead of special delegate class (in objective-C interface) we use callback mechanism for any feedback from device :
|
300
|
+
# if you want listen events from Line device - make Ruby function in your controller
|
301
|
+
# and post his url to this function
|
302
|
+
# after it you will receive events from device in your controller's function
|
303
|
+
# All events receive in one callback function
|
304
|
+
# use @params['delegateEvent'] for detect type of event
|
305
|
+
# List of events (equal to LineaDelegate interface methods, also see LineaSDK documentation for details about parameters) :
|
306
|
+
#
|
307
|
+
# @params['delegateEvent'] == 'connectionState'
|
308
|
+
# @params['state'] - int value
|
309
|
+
#
|
310
|
+
# @params['delegateEvent'] == 'buttonPressed'
|
311
|
+
# @params['which'] - int value
|
312
|
+
#
|
313
|
+
# @params['delegateEvent'] == 'buttonReleased'
|
314
|
+
# @params['which'] - int value
|
315
|
+
#
|
316
|
+
# @params['delegateEvent'] == 'barcodeData'
|
317
|
+
# @params['type'] - int value
|
318
|
+
# @params['barcode'] - string value
|
319
|
+
#
|
320
|
+
# @params['delegateEvent'] == 'magneticCardData'
|
321
|
+
# @params['track1'] - string value
|
322
|
+
# @params['track2'] - string value
|
323
|
+
# @params['track3'] - string value
|
324
|
+
#
|
325
|
+
# @params['delegateEvent'] == 'magneticCardRawData'
|
326
|
+
# @params['tracks'] - array of bytes value
|
327
|
+
#
|
328
|
+
# @params['delegateEvent'] == 'magneticCardEncryptedData'
|
329
|
+
# @params['encryption'] - int value
|
330
|
+
# @params['data'] - array of bytes value
|
331
|
+
#
|
332
|
+
# @params['delegateEvent'] == 'magneticCardEncryptedRawData'
|
333
|
+
# @params['encryption'] - int value
|
334
|
+
# @params['data'] - array of bytes value
|
335
|
+
#
|
336
|
+
#
|
337
|
+
# example (code in controller.rb) :
|
338
|
+
#
|
339
|
+
# require 'linea'
|
340
|
+
#
|
341
|
+
# class YoupageController < Rho::RhoController
|
342
|
+
#
|
343
|
+
# def index
|
344
|
+
# Linea.sharedDevice.addDelegate(url_for(:action => :linea_callback))
|
345
|
+
# render
|
346
|
+
# end
|
347
|
+
#
|
348
|
+
# def linea_callback
|
349
|
+
# puts 'callback'
|
350
|
+
# if @params['delegateEvent'] == 'connectionState'
|
351
|
+
# state = @params['state']
|
352
|
+
# end
|
353
|
+
# end
|
354
|
+
#
|
355
|
+
# ....
|
356
|
+
#
|
357
|
+
# delegate_callback - string
|
358
|
+
def addDelegate(delegate_callback)
|
359
|
+
end
|
360
|
+
|
361
|
+
# remove callback - see addDelegate function for more detail
|
362
|
+
# delegate_callback - string
|
363
|
+
def removeDelegate(delegate_callback)
|
364
|
+
end
|
365
|
+
|
366
|
+
def connect
|
367
|
+
end
|
368
|
+
|
369
|
+
def disconnect
|
370
|
+
end
|
371
|
+
|
372
|
+
# type - int
|
373
|
+
# return string
|
374
|
+
def barcodeType2Text(type)
|
375
|
+
end
|
376
|
+
|
377
|
+
def startScan
|
378
|
+
end
|
379
|
+
|
380
|
+
def stopScan
|
381
|
+
end
|
382
|
+
|
383
|
+
# return int
|
384
|
+
def getScanTimeout
|
385
|
+
end
|
386
|
+
|
387
|
+
# timeout - int
|
388
|
+
def setScanTimeout(timeout)
|
389
|
+
end
|
390
|
+
|
391
|
+
# return int
|
392
|
+
def getScanButtonMode
|
393
|
+
end
|
394
|
+
|
395
|
+
# mode - int
|
396
|
+
def setScanButtonMode(mode)
|
397
|
+
end
|
398
|
+
|
399
|
+
# return int
|
400
|
+
def getScanMode
|
401
|
+
end
|
402
|
+
|
403
|
+
# mode - int
|
404
|
+
def setScanMode(mode)
|
405
|
+
end
|
406
|
+
|
407
|
+
# barcode_type - int
|
408
|
+
# enabled - BOOL
|
409
|
+
def enableBarcode(barcode_type, enabled)
|
410
|
+
end
|
411
|
+
|
412
|
+
# enabled - BOOL
|
413
|
+
# volume - int
|
414
|
+
# beepData - array of int/fixnums
|
415
|
+
def setScanBeep(enabled, volume, beepData)
|
416
|
+
end
|
417
|
+
|
418
|
+
# return int
|
419
|
+
def getBatteryCapacity
|
420
|
+
end
|
421
|
+
|
422
|
+
# return int
|
423
|
+
def getBatteryVoltage
|
424
|
+
end
|
425
|
+
|
426
|
+
# type - int
|
427
|
+
# return BOOL
|
428
|
+
def isBarcodeEnabled?(type)
|
429
|
+
end
|
430
|
+
|
431
|
+
# type - int
|
432
|
+
# return BOOL
|
433
|
+
def isBarcodeSupported?(type)
|
434
|
+
end
|
435
|
+
|
436
|
+
# volume - int
|
437
|
+
# beepData - array of int/fixnums
|
438
|
+
def playSound(volume, beepData)
|
439
|
+
end
|
440
|
+
|
441
|
+
def msStartScan
|
442
|
+
end
|
443
|
+
|
444
|
+
def msStopScan
|
445
|
+
end
|
446
|
+
|
447
|
+
# return int
|
448
|
+
def getMSCardDataMode
|
449
|
+
end
|
450
|
+
|
451
|
+
# mode - int
|
452
|
+
def setMSCardDataMode(mode)
|
453
|
+
end
|
454
|
+
|
455
|
+
# return BOOL
|
456
|
+
def getCharging?
|
457
|
+
end
|
458
|
+
|
459
|
+
# enabled - BOOL
|
460
|
+
def setCharging(enabled)
|
461
|
+
end
|
462
|
+
|
463
|
+
# path - string
|
464
|
+
# return HASH with firmwareInfo struct fields (all keys with value type):
|
465
|
+
# 'deviceName' - string
|
466
|
+
# 'deviceModel' - string
|
467
|
+
# 'firmwareRevision' - string
|
468
|
+
# 'firmwareRevisionNumber' - int
|
469
|
+
def getFirmwareFileInformation(path)
|
470
|
+
end
|
471
|
+
|
472
|
+
# path - string
|
473
|
+
def updateFirmware(path)
|
474
|
+
end
|
475
|
+
|
476
|
+
# return int
|
477
|
+
def getSyncButtonMode
|
478
|
+
end
|
479
|
+
|
480
|
+
# mode - int
|
481
|
+
def setSyncButtonMode(mode)
|
482
|
+
end
|
483
|
+
|
484
|
+
# track1 - string
|
485
|
+
# track2 - string
|
486
|
+
# return nil if nothing or HASH with financialCard struct (all keys with value type):
|
487
|
+
# 'accountNumber' - string
|
488
|
+
# 'cardholderName' - string
|
489
|
+
# 'exirationYear' - int
|
490
|
+
# 'exirationMonth' - int
|
491
|
+
# 'serviceCode' - string
|
492
|
+
# 'discretionaryData' - string
|
493
|
+
# 'firstName' - string
|
494
|
+
# 'lastName' - string
|
495
|
+
def msProcessFinancialCard(track1, track2)
|
496
|
+
end
|
497
|
+
|
498
|
+
# return int
|
499
|
+
def getBarcodeTypeMode
|
500
|
+
end
|
501
|
+
|
502
|
+
# mode - int
|
503
|
+
# return BOOL
|
504
|
+
def setBarcodeTypeMode?(mode)
|
505
|
+
end
|
506
|
+
|
507
|
+
# return array of bytes
|
508
|
+
def cryptoRawGenerateRandomData
|
509
|
+
end
|
510
|
+
|
511
|
+
# keyID - int
|
512
|
+
# encryptedData - array of bytes
|
513
|
+
def cryptoRawSetKey(keyID, encryptedData)
|
514
|
+
end
|
515
|
+
|
516
|
+
# keyID - int
|
517
|
+
# key - arrays of byte
|
518
|
+
# oldKey - arrays of byte
|
519
|
+
def cryptoSetKey(keyID, key, oldKey)
|
520
|
+
end
|
521
|
+
|
522
|
+
# randomData - array of bytes
|
523
|
+
# return array of bytes
|
524
|
+
def cryptoRawAuthenticateLinea(randomData)
|
525
|
+
end
|
526
|
+
|
527
|
+
# key - array of bytes
|
528
|
+
# return BOOL
|
529
|
+
def cryptoAuthenticateLinea?(key)
|
530
|
+
end
|
531
|
+
|
532
|
+
# data - array of bytes
|
533
|
+
# return BOOL
|
534
|
+
def barcodeEngineWrite?(data)
|
535
|
+
end
|
536
|
+
|
537
|
+
# data - string
|
538
|
+
# return BOOL
|
539
|
+
def barcodeEngineWriteString?(data)
|
540
|
+
end
|
541
|
+
|
542
|
+
# max_length - int with maximum length of readed data in bytes
|
543
|
+
# timeout - float
|
544
|
+
# return array of bytes or nil if nothing
|
545
|
+
def barcodeEngineRead(max_length, timeout)
|
546
|
+
end
|
547
|
+
|
548
|
+
# enabled - BOOL
|
549
|
+
def barcodeEnginePowerControl(enable)
|
550
|
+
end
|
551
|
+
|
552
|
+
# params - string
|
553
|
+
def barcodeOpticonSetParams(params)
|
554
|
+
end
|
555
|
+
|
556
|
+
end
|
557
|
+
|
558
|
+
|
559
|
+
## Simple example of using Line API in ruby controller
|
560
|
+
|
561
|
+
This is simple example of ruby code where you can see how LineSDK is used in ruby controller.
|
562
|
+
|
563
|
+
:::ruby
|
564
|
+
require 'rho/rhocontroller'
|
565
|
+
require 'linea'
|
566
|
+
|
567
|
+
|
568
|
+
class ScanbarcodeController < Rho::RhoController
|
569
|
+
|
570
|
+
|
571
|
+
def index
|
572
|
+
puts 'ScanBarcodeController.index'
|
573
|
+
Linea.sharedDevice.addDelegate(url_for(:action => :linea_callback))
|
574
|
+
render
|
575
|
+
end
|
576
|
+
|
577
|
+
|
578
|
+
def do_connect
|
579
|
+
begin
|
580
|
+
Linea.sharedDevice.connect
|
581
|
+
rescue
|
582
|
+
puts 'Linea exception catched : '+$!.to_s
|
583
|
+
end
|
584
|
+
end
|
585
|
+
|
586
|
+
def do_disconnect
|
587
|
+
begin
|
588
|
+
Linea.sharedDevice.disconnect
|
589
|
+
rescue
|
590
|
+
puts 'Linea exception catched : '+$!.to_s
|
591
|
+
end
|
592
|
+
end
|
593
|
+
|
594
|
+
def do_startScan
|
595
|
+
begin
|
596
|
+
Linea.sharedDevice.startScan
|
597
|
+
rescue
|
598
|
+
puts 'Linea exception catched : '+$!.to_s
|
599
|
+
end
|
600
|
+
end
|
601
|
+
|
602
|
+
def do_stopScan
|
603
|
+
begin
|
604
|
+
Linea.sharedDevice.stopScan
|
605
|
+
rescue
|
606
|
+
puts 'Linea exception catched : '+$!.to_s
|
607
|
+
end
|
608
|
+
end
|
609
|
+
|
610
|
+
def do_msStartScan
|
611
|
+
begin
|
612
|
+
Linea.sharedDevice.msStartScan
|
613
|
+
rescue
|
614
|
+
puts 'Linea exception catched : '+$!.to_s
|
615
|
+
end
|
616
|
+
end
|
617
|
+
|
618
|
+
def do_msStopScan
|
619
|
+
begin
|
620
|
+
Linea.sharedDevice.msStopScan
|
621
|
+
rescue
|
622
|
+
puts 'Linea exception catched : '+$!.to_s
|
623
|
+
end
|
624
|
+
end
|
625
|
+
|
626
|
+
def do_enableAllBarcodeTypes
|
627
|
+
begin
|
628
|
+
Linea.sharedDevice.enableBarcode(Linea::BAR_ALL, true)
|
629
|
+
rescue
|
630
|
+
puts 'Linea exception catched : '+$!.to_s
|
631
|
+
end
|
632
|
+
end
|
633
|
+
|
634
|
+
def linea_callback
|
635
|
+
puts 'linea delegate : '+@params['delegateEvent']
|
636
|
+
if @params['delegateEvent'] == 'connectionState'
|
637
|
+
state = @params['state']
|
638
|
+
puts 'connection state : ' + state.to_s
|
639
|
+
end
|
640
|
+
|
641
|
+
if @params['delegateEvent'] == 'barcodeData'
|
642
|
+
barcode = @params['barcode']
|
643
|
+
type = @params['type']
|
644
|
+
puts 'recognized barcode data : '+barcode+' barcode type = '+type.to_s
|
645
|
+
end
|
646
|
+
|
647
|
+
if @params['delegateEvent'] == 'magneticCardData'
|
648
|
+
track1 = @params['track1']
|
649
|
+
track2 = @params['track2']
|
650
|
+
track3 = @params['track3']
|
651
|
+
if track1 != nil
|
652
|
+
puts ' card recognized track1 = '+track1
|
653
|
+
end
|
654
|
+
if track2 != nil
|
655
|
+
puts ' card recognized track2 = '+track2
|
656
|
+
end
|
657
|
+
if track3 != nil
|
658
|
+
puts ' card recognized track3 = '+track3
|
659
|
+
end
|
660
|
+
end
|
661
|
+
|
662
|
+
end
|
663
|
+
|
664
|
+
|
665
|
+
end
|
666
|
+
|
667
|
+
## Complete example of using Linea API
|
668
|
+
|
669
|
+
You can find complete example of using Linea API in <b>https://github.com/rhomobile/linea-rhodes-demo</b> complete Rhodes application. In this example you can see native extension with implementation of Ruby interface of LineSDK for Rhodes platform and example application with this native extension.
|
670
|
+
Please read the next part of this document for setup you Rhodes XCode project for build for using Linea device - require few changes in XCode project.
|
671
|
+
|
672
|
+
In application you can see two pages:
|
673
|
+
|
674
|
+
* Info page - where you can see few Linea device parameters
|
675
|
+
|
676
|
+
* Barcode scan page - where you can do some Linea operations.
|
677
|
+
|
678
|
+
In Barcode scan page try to use next sequence of buttons :
|
679
|
+
[addDelegate]
|
680
|
+
[connect]
|
681
|
+
see events in Log box
|
682
|
+
|
683
|
+
for scan barcode use hardware button or [startScan] - scan code by device [stopScan]
|
684
|
+
|
685
|
+
## How to use Linea native extension in your application
|
686
|
+
|
687
|
+
* copy <b>https://github.com/rhomobile/linea-rhodes-demo/tree/master/extensions/linea</b> native extension folder from <b>linea-rhodes</b> example application to you <b>extensions</b> folder in root folder of your application.
|
688
|
+
|
689
|
+
* add <b>linea</b> to list of your extension list in application's <b>build.yml</b> file
|
690
|
+
|
691
|
+
* Make following changes in rhodes XCode project (located in $RHODES_ROOT/platform/iphone/rhorunner.xcodeproj ):
|
692
|
+
- go to <b>Frameworks</b> and add <b>ExternalAccessory</b> framework
|
693
|
+
- open <b>info.plist</b> file and add <b>"UISupportedExternalAccessoryProtocols"</b> parameter (array type) with two items : <b> com.datecs.linea.pro.msr</b> and <b>com.datecs.linea.pro.bar</b>
|
694
|
+
|
695
|
+
* Put LineaSDK binary and header ( <b>linLineSDK.a</b> and <b>LineSDK.h</b>) into <b>[your application root]/extensions/linea/ext/linea/platform/iphone/LineaSDK/</b>.
|
696
|
+
|
697
|
+
build/run application by <b>"rake run:iphone"</b> or <b>"rake device:iphone:production"</b>
|
698
|
+
|
699
|
+
Also see Rhodes documentation about ExtendingRhodes - how add and use extension in Rhodes.
|
data/doc/rhom.txt
CHANGED
@@ -785,7 +785,8 @@ If your application requires that the local database is encrypted on the filesys
|
|
785
785
|
* Windows Mobile: Uses RC4 algorithm from Windows Mobile SDK.
|
786
786
|
|
787
787
|
### Blackberry Notes
|
788
|
-
* Blackberry
|
788
|
+
* Any Blackberry versions: Uses AES 128 ecryption algorithm from Blackberry JDK with HSQL database
|
789
|
+
* Blackberry JDE >= 5.0 with SQLITE: Uses built-in encryption library for SQLite database.
|
789
790
|
|
790
791
|
**NOTE: Bulk sync is not supported in this mode.**
|
791
792
|
|