Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vuhuy authored Mar 7, 2023
1 parent 510a1e3 commit 7e91cae
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ The OneDriveClient library for CODESYS needs onedrive-uploader to be available o

### Configure using embedded external files

OneDriveClient needs to know where it can find the onedrive-uploader binary and configuration file. Embed both files in your CODESYS project and define the OneDriveClient configuration struct to let OneDriveClient know to find it.

```
VAR
sAppPath : STRING(80) := '';
Expand All @@ -104,6 +106,8 @@ OneDriveClient.ChangeMode(stConfig := stConfig);

### List remote directory

List remote directory `/`.

```
VAR
stConfig : OneDriveClient.ONEDRIVE_CONFIG;
Expand All @@ -122,6 +126,8 @@ OneDriveClient.OneDriveList(

### Create remote directory

Create remote directory `/onedrive-test`.

```
VAR
stConfig : OneDriveClient.ONEDRIVE_CONFIG;
Expand All @@ -136,6 +142,8 @@ OneDriveClient.OneDriveMakeDir(

### Upload local file to remote directory

Upload local file `/home/root/closetoyou.wav` to remote directory `/onedrive-test`.

```
VAR
stConfig : OneDriveClient.ONEDRIVE_CONFIG;
Expand All @@ -152,6 +160,8 @@ OneDriveClient.OneDriveUpload(

### Get info of remote file or directory

Get info of remote file `/onedrive-test/closetoyou.wav`.

```
VAR
stConfig : OneDriveClient.ONEDRIVE_CONFIG;
Expand All @@ -168,6 +178,8 @@ OneDriveClient.OneDriveInfo(

### Download remote file to local directory

Download the remote file `/onedrive-test/closetoyou.wav` to the local directory `/tmp`.

```
VAR
stConfig : OneDriveClient.ONEDRIVE_CONFIG;
Expand All @@ -184,10 +196,12 @@ OneDriveClient.OneDriveDownload(

### Remove remote file or directory

Remove the remote directory `/onedrive-test`.

```
VAR
stConfig : OneDriveClient.ONEDRIVE_CONFIG;
sRemotePath : STRING(400) := '/onedrive-test/';
sRemotePath : STRING(400) := '/onedrive-test';
END_VAR
OneDriveClient.OneDriveRemove(
Expand All @@ -196,7 +210,7 @@ OneDriveClient.OneDriveRemove(
);
```

## UTF-8 encoding and WSTRING
### UTF-8 encoding and WSTRING

CODESYS does not have proper support for UTF-8 encoded characters in STRING types prior to CODESYS 3.5 SP18. If available, enabling this option should support UTF-8 encoded paths with STRING (untested). Otherwise use WSTRING and interact with the library through the helper functions `NameToWstring` and `PathFromWstring`.

Expand Down Expand Up @@ -233,4 +247,4 @@ OneDriveClient.NameToWstring(stItem := astItems[1], wsItemName := wsDirectoryNam
## Credits

-[Imotik](https://www.imotik.nl/en/)
-[virtualzone](https://github.com/virtualzone)/[onedrive-uploader](https://github.com/virtualzone/onedrive-uploader)
-[virtualzone](https://github.com/virtualzone)/[onedrive-uploader](https://github.com/virtualzone/onedrive-uploader)

0 comments on commit 7e91cae

Please sign in to comment.