author: bocianu bocianu@gmail.com
This library provides an easy interface to store so called APPKEYS or cookies on SD card of your fujinet device.
Those tiny data blobs can be used by applications to store some data, like configuration, keys, tokens on the device itself.
They are not public, and persistent on your device, until you will remove them manually from your SD card.
Maximum size of single cookie is 64 bytes.
https://fujinet.online/
This library is a part of 'blibs' - set of custom Mad-Pascal libraries.
https://gitlab.com/bocianu/blibs
name: | value: | description: |
---|---|---|
MAX_COOKIE_SIZE | 64 |
name: | type: | description: |
---|---|---|
TCookieFrame | record
end; | Structure used to retrieve cookie from storage |
TCookieInfo | record
end; | Structure used to set cookie info in Open Command |
name: | description: |
---|---|
InitCookie | procedure InitCookie(creator: word; app, key: byte);Inits cookie storage params, and sets unique filename based on provided ID_keys. Must be called at least once, before any Set or Get command is issued.
parameters: |
SetCookie | function SetCookie(val: pointer; vlength: word):byte;Stores new cookie value.
parameters:returns: |
GetCookie | function GetCookie(val: pointer):byte;Restores cookie value from device, to buffer. Size of received data is returned in cookie.len field.
parameters:returns: |