Skip to content

Commit 74c3cb6

Browse files
Release 4.2.0 (#4)
# Release 4.2.0 ## New features - Supporting now SFTP and FTPS - Function 'putFile' to transfer files to FTP server - Option to save data directly as JPG (without image processing) - Providing information of data transfer success via 'OnNewStatusFileTransferSuccess' event (can be used in async mode as well) ## Improvements - "sendData"- and "sendImage"-function return now transfer success (does not work with async mode) ## Bugfix - Async feature did not work
1 parent 41e3ca5 commit 74c3cb6

11 files changed

Lines changed: 2570 additions & 505 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## Release 4.2.0
5+
6+
### New features
7+
- Supporting now SFTP and FTPS
8+
- Function 'putFile' to transfer files to FTP server
9+
- Option to save data directly as JPG (without image processing)
10+
- Providing information of data transfer success via 'OnNewStatusFileTransferSuccess' event (can be used in async mode as well)
11+
12+
### Improvements
13+
- "sendData"- and "sendImage"-function return now transfer success (does not work with async mode)
14+
15+
### Bugfix
16+
- Async feature did not work
17+
418
## Release 4.1.0
519

620
### New features

CSK_Module_FTPClient/pages/pages/CSK_Module_FTPClient/CSK_Module_FTPClient.html

Lines changed: 412 additions & 105 deletions
Large diffs are not rendered by default.

CSK_Module_FTPClient/project.mf.xml

Lines changed: 114 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ It is possible to register to events of other apps to put the received data to t
3434
<desc>Type of data to save on FTP server.</desc>
3535
<item desc="Store STRING data as .dat file" name="DATA">DATA</item>
3636
<item desc="Store data as JPG image file." name="JPG">JPG</item>
37+
<item desc="Store binary data as JPG image file." name="RAW_JPG">RAW_JPG</item>
3738
</enum>
3839
<serves>
3940
<event name="OnNewServerIP">
@@ -135,6 +136,55 @@ It is possible to register to events of other apps to put the received data to t
135136
<desc>Notify if module can be used on device.</desc>
136137
<param desc="Status" multiplicity="1" name="status" type="bool"/>
137138
</event>
139+
<event name="OnNewStatusPathToLocalFile">
140+
<desc>Notify path to local file to send to FTP server.</desc>
141+
<param desc="Path" multiplicity="1" name="path" type="string"/>
142+
</event>
143+
<event name="OnNewStatusMode">
144+
<desc>Notify mode of FTP connection to use.</desc>
145+
<param desc="Mode" multiplicity="1" name="mode" type="string"/>
146+
</event>
147+
<event name="OnNewStatusSFTPPrivateKeyPath">
148+
<desc>Notify path to private key file for SFTP connection.</desc>
149+
<param desc="Path" multiplicity="1" name="path" type="string"/>
150+
</event>
151+
<event name="OnNewStatusClearPrivateKeyPassword">
152+
<desc>Clear private key password within UI.</desc>
153+
<param desc="Empty string." multiplicity="1" name="empty" type="string"/>
154+
</event>
155+
<event name="OnNewStatusSFTPPublicKeyPath">
156+
<desc>Notify path to public key for SFTP connection.</desc>
157+
<param desc="Path" multiplicity="1" name="path" type="string"/>
158+
</event>
159+
<event name="OnNewStatusKnownHostFilePath">
160+
<desc>Notify path to known host file used for SFTP connection.</desc>
161+
<param desc="Path" multiplicity="1" name="path" type="string"/>
162+
</event>
163+
<event name="OnNewStatusCABundlePath">
164+
<desc>Notify path to CA bundle file to use for SFTP connection.</desc>
165+
<param desc="Path" multiplicity="1" name="path" type="string"/>
166+
</event>
167+
<event name="OnNewStatusClientCertificatePath">
168+
<desc>Notify path to client certificate to use for FTPS connection.</desc>
169+
<param desc="Path" multiplicity="1" name="path" type="string"/>
170+
</event>
171+
<event name="OnNewStatusClientCertificatePrivateKeyFilePath">
172+
<desc>Notify path to client certificate private key file.</desc>
173+
<param desc="Path" multiplicity="1" name="path" type="string"/>
174+
</event>
175+
<event name="OnNewStatusPeerVerification">
176+
<desc>Notify status to use peer verification for FTPS connection.</desc>
177+
<param desc="Status" multiplicity="1" name="status" type="bool"/>
178+
</event>
179+
<event name="OnNewStatusFTPSSecurityProtocol">
180+
<desc>Notify mode of security protocol to use for FTPS connection.</desc>
181+
<param desc="Mode" multiplicity="1" name="mode" type="string"/>
182+
</event>
183+
<event name="OnNewStatusFileTransferSuccess">
184+
<desc>Notify success status of file transfer.</desc>
185+
<param desc="Succes" multiplicity="1" name="success" type="bool"/>
186+
<param desc="Name of file (optionally with full file path on device) to transfer.&#10;Not supported in async mode." multiplicity="?" name="file" type="string"/>
187+
</event>
138188
<function name="pageCalled">
139189
<desc>Function to register "OnResume" of the module UI (only as helper function).</desc>
140190
<return desc="Empty string (only needed to simplify binding)." multiplicity="1" name="empty" type="string"/>
@@ -190,6 +240,7 @@ It is possible to register to events of other apps to put the received data to t
190240
<desc>Send image.</desc>
191241
<param alias="Image" desc="Image to send" multiplicity="1" name="img" type="object"/>
192242
<param desc="" multiplicity="?" name="filename" type="string"/>
243+
<return desc="Success" multiplicity="1" name="success" type="bool"/>
193244
</function>
194245
<function name="getFTPStatus">
195246
<desc>Get current FTP connection status.</desc>
@@ -216,6 +267,7 @@ If TRUE it will send the content in its own thread, but other apps can further r
216267
<desc>Send data to connected FTP server.</desc>
217268
<param desc="Data to send." multiplicity="1" name="data" type="auto"/>
218269
<param desc="Filename to store send data on FTP server." multiplicity="1" name="filename" type="string"/>
270+
<return desc="Success of data transfer.&#10;Not reliable if running async mode. In this case register to 'OnNewStatusFileTransferSuccess' event to track success." multiplicity="1" name="success" type="bool"/>
219271
</function>
220272
<function name="setLoadOnReboot">
221273
<desc>Configure if this module should load its saved parameters at app/device boot up.</desc>
@@ -288,6 +340,63 @@ If TRUE it will send the content in its own thread, but other apps can further r
288340
<function name="resetModule">
289341
<desc>Function to reset main configuration of module.</desc>
290342
</function>
343+
<function name="putFile">
344+
<desc>Function to put a local file to the FTP server.</desc>
345+
<param desc="Source path of the file to upload." multiplicity="1" name="localSource" type="string"/>
346+
<param desc="Target name of the file to upload. Can be a relative or absolute path in FTP path notation." multiplicity="?" name="destination" type="string"/>
347+
<return desc="Success" multiplicity="1" name="success" type="bool"/>
348+
</function>
349+
<function name="setLocalPath">
350+
<desc>Function to set path to local file to send to FTP server.</desc>
351+
<param desc="Path" multiplicity="1" name="path" type="string"/>
352+
</function>
353+
<function name="putFileViaUI">
354+
<desc>Function to send predefined file (see 'setLocalPath') to FTP server.</desc>
355+
</function>
356+
<function name="setSFTPPrivateKeyPath">
357+
<desc>Function to set path to private key file for SFTP connection.</desc>
358+
<param desc="Path" multiplicity="1" name="path" type="string"/>
359+
</function>
360+
<function name="setSFTPPrivateKeyPassword">
361+
<desc>Function to set password of private key file for SFTP connection.</desc>
362+
<param desc="Password" multiplicity="1" name="password" type="string"/>
363+
</function>
364+
<function name="setSFTPPublicKeyPath">
365+
<desc>Function to set path to public key file for SFTP connection.</desc>
366+
<param desc="Path" multiplicity="1" name="path" type="string"/>
367+
</function>
368+
<function name="setKnownHostFilePath">
369+
<desc>Function to set path to known host file for SFTP connection.</desc>
370+
<param desc="Path" multiplicity="1" name="path" type="string"/>
371+
</function>
372+
<function name="setCABundleFilePath">
373+
<desc>Function to set path to CA bundle file for FTPS connection.</desc>
374+
<param desc="Path" multiplicity="1" name="path" type="string"/>
375+
</function>
376+
<function name="setClientCertificatePrivateKeyPath">
377+
<desc>Function to set path to client certificate private key file for FTPS connection.</desc>
378+
<param desc="Path" multiplicity="1" name="path" type="string"/>
379+
</function>
380+
<function name="setClientCertificateFilePath">
381+
<desc>Function to set path to client certificate file for FTPS connection.</desc>
382+
<param desc="Path" multiplicity="1" name="path" type="string"/>
383+
</function>
384+
<function name="setClientCertificatePrivateKeyPassword">
385+
<desc>Function to set password of client certificate private key file for FTPS connection.</desc>
386+
<param desc="Password" multiplicity="1" name="password" type="string"/>
387+
</function>
388+
<function name="setPeerVerificationStatus">
389+
<desc>Function to set status to use peer verification for FTPS connection.</desc>
390+
<param desc="Status" multiplicity="1" name="status" type="bool"/>
391+
</function>
392+
<function name="setFTPSSecurityProtolMode">
393+
<desc>Function to set mode of FTPS security protocol.</desc>
394+
<param desc="Mode" multiplicity="1" name="mode" type="string"/>
395+
</function>
396+
<function name="setFTPMode">
397+
<desc>Function to set FTP mode.</desc>
398+
<param desc="Mode" multiplicity="1" name="mode" type="string"/>
399+
</function>
291400
</serves>
292401
</crown>
293402
<crown name="FTPClient_FC">
@@ -299,10 +408,10 @@ If TRUE it will send the content in its own thread, but other apps can further r
299408
<serves>
300409
<function name="create">
301410
<desc>Internally used CSK_FlowConfig create function.</desc>
302-
<param desc="Data type of data1 ('DATA' per default).&#10;&#10;'DATA' = Store STRING data as .dat file&#10;&#10;'JPG' = Store data as JPG image file." multiplicity="?" name="dataType1" ref="CSK_FTPClient.DataType" type="enum"/>
303-
<param desc="Data type of data2 ('DATA' per default).&#10;&#10;'DATA' = Store STRING data as .dat file&#10;&#10;'JPG' = Store data as JPG image file." multiplicity="?" name="dataType2" ref="CSK_FTPClient.DataType" type="enum"/>
304-
<param desc="Data type of data3 ('DATA' per default).&#10;&#10;'DATA' = Store STRING data as .dat file&#10;&#10;'JPG' = Store data as JPG image file." multiplicity="?" name="dataType3" ref="CSK_FTPClient.DataType" type="enum"/>
305-
<param desc="Data type of data4 ('DATA' per default).&#10;&#10;'DATA' = Store STRING data as .dat file&#10;&#10;'JPG' = Store data as JPG image file." multiplicity="?" name="dataType4" ref="CSK_FTPClient.DataType" type="enum"/>
411+
<param desc="Data type of data1 ('DATA' per default).&#10;&#10;'DATA' = Store STRING data as .dat file&#10;&#10;'JPG' = Store data as JPG image file.&#10;&#10;'RAW_JPG' = Store binary data as JPG image file." multiplicity="?" name="dataType1" ref="CSK_FTPClient.DataType" type="enum"/>
412+
<param desc="Data type of data2 ('DATA' per default).&#10;&#10;'DATA' = Store STRING data as .dat file&#10;&#10;'JPG' = Store data as JPG image file.&#10;&#10;'RAW_JPG' = Store binary data as JPG image file." multiplicity="?" name="dataType2" ref="CSK_FTPClient.DataType" type="enum"/>
413+
<param desc="Data type of data3 ('DATA' per default).&#10;&#10;'DATA' = Store STRING data as .dat file&#10;&#10;'JPG' = Store data as JPG image file.&#10;&#10;'RAW_JPG' = Store binary data as JPG image file." multiplicity="?" name="dataType3" ref="CSK_FTPClient.DataType" type="enum"/>
414+
<param desc="Data type of data4 ('DATA' per default).&#10;&#10;'DATA' = Store STRING data as .dat file&#10;&#10;'JPG' = Store data as JPG image file.&#10;&#10;'RAW_JPG' = Store binary data as JPG image file." multiplicity="?" name="dataType4" ref="CSK_FTPClient.DataType" type="enum"/>
306415
<param desc="Status if filename should be generated by date/time or is provided via source of data1 (TRUE per default)." multiplicity="?" name="autoName1" type="bool"/>
307416
<param desc="Status if filename should be generated by date/time or is provided via source of data2 (TRUE per default)." multiplicity="?" name="autoName2" type="bool"/>
308417
<param desc="Status if filename should be generated by date/time or is provided via source of data3 (TRUE per default)." multiplicity="?" name="autoName3" type="bool"/>
@@ -322,7 +431,7 @@ If TRUE it will send the content in its own thread, but other apps can further r
322431
</crown>
323432
</crown>
324433
<meta key="author">SICK AG</meta>
325-
<meta key="version">4.1.0</meta>
434+
<meta key="version">4.2.0</meta>
326435
<meta key="priority">low</meta>
327436
<meta key="copy-protected">false</meta>
328437
<meta key="read-protected">false</meta>

CSK_Module_FTPClient/scripts/CSK_Module_FTPClient.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ local function main()
6969
-- Set username / password via script
7070
7171
CSK_FTPClient.setFTPServerIP('192.168.0.123')
72-
CSK_FTPClient.setFTPPort = 21
73-
CSK_FTPClient.setUsername = 'tester'
74-
CSK_FTPClient.setPassword = 'password'
72+
CSK_FTPClient.setFTPPort(21)
73+
CSK_FTPClient.setUsername('tester')
74+
CSK_FTPClient.setPassword('password')
7575
CSK_FTPClient.setPassiveMode(true)
7676
7777
local success = CSK_FTPClient.connectFTPClient()

0 commit comments

Comments
 (0)