UISS
MODULES (Add-On and VB)
Guy,
de ON6MU
https://on6mu.groups.io/
Since UISS version 3.0 their has been add-on
implementation but not as versatile as version 3.3 (or higher).
This allows users to program tools to be
plugged in UISS. You can compare it like ISS which
becomes more versatile and powerful as more modules are connected
to it.
If you want to program a tool for UISS and
use the features of UISS in your own program then this is the way
to do it.
From UISS v3.3 and upwards you can
read the received packets that UISS receives. You can
force UISS to act as kind of server which will parse the received
packet data to the registry from where you can read it real-time.
In VB the way you read the registry of the
UISS packet received header and data (raw):
Public Function getstring(Hkey As Long,
strPath As String, strValue As String)
Dim keyhand As Long
Dim datatype As Long
Dim lResult As Long
Dim strBuf As String
Dim lDataBufSize As Long
Dim intZeroPos As Integer
r = RegOpenKey(Hkey,
strPath, keyhand)
lResult =
RegQueryValueEx(keyhand, strValue, 0&, lValueType, ByVal
0&, lDataBufSize)
If lValueType = REG_SZ
Then
strBuf
= String(lDataBufSize, " ")
lResult
= RegQueryValueEx(keyhand, strValue, 0&, 0&, ByVal
strBuf, lDataBufSize)
If
lResult = ERROR_SUCCESS Then
intZeroPos = InStr(strBuf, Chr$(0))
If intZeroPos > 0 Then
getstring = Left$(strBuf, intZeroPos - 1)
Else
getstring = strBuf
End If
End
If
End If
End Function
And call the function like:
UISS_RX_Packet$ =
getstring(HKEY_CURRENT_USER, "Software\UISS\RXData",
"String")
Or check for the Status of UISS:
UISS_Status$ =
getstring(HKEY_CURRENT_USER, "Software\UISS\Status",
"String")
Of course UISS needs to be set in Server
Mode. You can do this all automatically by setting the ModuleNeed
for your UISS add-on. All this and more is written down in a
configuration file or module file that UISS reads the information
from and act accordingly. More info and examples about this can
be received by mailing me.
UISS Server Mode
You can set UISS in and experimental Server
Mode by editing the UISS.INI file.
Look for the topic [UISS Server] and change
the value beneath it to 1
Set it back to 0 will disable the Server
Mode.
When UISS is in server mode it will parse
all received packets (including the header) to the Windows
registry.
You can recognize UISS Server Mode by
looking at the logo (upper right) where youll see a small
+. Or look in the About (Help menu).
VB Source code
This simple example could help you on your
way to program a module (with some conversion it could be used in
other programming languages too). A more advanced example can be
downloaded at my group https://on6mu.groups.io/
or my website.
In all, your VB program could look like
this:
Put In your MODULE.BAS:
'UISS Client Registry
Public Const HKEY_CLASSES_ROOT =
&H80000000
Public Const HKEY_CURRENT_USER =
&H80000001
Public Const HKEY_LOCAL_MACHINE =
&H80000002
Public Const HKEY_USERS = &H80000003
Public Const HKEY_PERFORMANCE_DATA =
&H80000004
Public Const ERROR_SUCCESS = 0&
Public Const REG_SZ = 1 ' Unicode nul
terminated String
Public Const REG_DWORD = 4 ' 32-bit number
Declare Function RegCloseKey Lib
"advapi32.dll" (ByVal Hkey As Long) As Long
Declare Function RegCreateKey Lib
"advapi32.dll" Alias "RegCreateKeyA" (ByVal
Hkey As Long, ByVal lpSubKey As String, phkResult As Long) As
Long
Declare Function RegDeleteKey Lib
"advapi32.dll" Alias "RegDeleteKeyA" (ByVal
Hkey As Long, ByVal lpSubKey As String) As Long
Declare Function RegDeleteValue Lib
"advapi32.dll" Alias "RegDeleteValueA" (ByVal
Hkey As Long, ByVal lpValueName As String) As Long
Declare Function RegOpenKey Lib
"advapi32.dll" Alias "RegOpenKeyA" (ByVal
Hkey As Long, ByVal lpSubKey As String, phkResult As Long) As
Long
Declare Function RegQueryValueEx Lib
"advapi32.dll" Alias "RegQueryValueExA"
(ByVal Hkey As Long, ByVal lpValueName As String, ByVal
lpReserved As Long, lpType As Long, lpData As Any, lpcbData As
Long) As Long
Declare Function RegSetValueEx Lib
"advapi32.dll" Alias "RegSetValueExA" (ByVal
Hkey As Long, ByVal lpValueName As String, ByVal Reserved As
Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long)
As Long
Public Function getstring(Hkey As Long,
strPath As String, strValue As String)
Dim keyhand As Long
Dim datatype As Long
Dim lResult As Long
Dim strBuf As String
Dim lDataBufSize As Long
Dim intZeroPos As Integer
r = RegOpenKey(Hkey,
strPath, keyhand)
lResult =
RegQueryValueEx(keyhand, strValue, 0&, lValueType, ByVal
0&, lDataBufSize)
If lValueType = REG_SZ
Then
strBuf
= String(lDataBufSize, " ")
lResult
= RegQueryValueEx(keyhand, strValue, 0&, 0&, ByVal
strBuf, lDataBufSize)
If
lResult = ERROR_SUCCESS Then
intZeroPos = InStr(strBuf, Chr$(0))
If intZeroPos > 0 Then
getstring = Left$(strBuf, intZeroPos - 1)
Else
getstring = strBuf
End If
End
If
End If
End Function
Function getdword(ByVal Hkey As Long, ByVal
strPath As String, ByVal strValueName As String) As Long
Dim lResult As Long
Dim lValueType As Long
Dim lBuf As Long
Dim lDataBufSize As Long
Dim r As Long
Dim keyhand As Long
r = RegOpenKey(Hkey,
strPath, keyhand)
' Get length/data type
lDataBufSize = 4
lResult =
RegQueryValueEx(keyhand, strValueName, 0&, lValueType, lBuf,
lDataBufSize)
If lResult =
ERROR_SUCCESS Then
If
lValueType = REG_DWORD Then
getdword = lBuf
End
If
End If
r = RegCloseKey(keyhand)
End Function
Public Function DeleteValue(ByVal Hkey As
Long, ByVal strPath As String, ByVal strValue As String)
'EXAMPLE:
'
'Call
DeleteValue(HKEY_CURRENT_USER, "Software\UISS\Status",
"Dword")
'
Dim keyhand As Long
r = RegOpenKey(Hkey,
strPath, keyhand)
r =
RegDeleteValue(keyhand, strValue)
r = RegCloseKey(keyhand)
End Function
Function UISS_Folder() As String
'Check where current UISS
path is. Can be useful if your application have to
'know where to look AND
when using more then one UISS copy running at the same time!
'This can be done by
comparing the path where your application is installed with the
'UISS path in the
registry.
'
'Works only with UISS 3.4
or higher!!! else it returns an empty string.
'
'Returns the UISS Path
UISS_Folder =
getstring(HKEY_CURRENT_USER, "Software\UISS\Path",
"String")
End Function
Paste this code in your Form after putting
one text-box and a timer on it:
And set the Text-box properties
Multiline = True
''UISS client example, de ON6MU
'To be used as UISS module (add-on)
'
'This simple source code example
demonstrates how to read
'the raw packet data parsed to the registry
by UISS
'acting as a server.
'Place a text-box (Text1) and a timer
(Timer1) on your
'form and paste this code
And set the Text1-box properties:
Multiline = True
ScrollBars = 2 - Vertical
'
'A more advanced example can also be
downloaded at https://www.qsl.net/on6mu
Dim UISS_RX_Packet As String 'contains the
received raw packet data
Dim UISS_RX_Packet_Read As String 'contains
the previous received packet
Sub CheckStatus()
'Check if UISS Server is active, and
if AGWPE is active
UISS_Status$ =
getstring(HKEY_CURRENT_USER, "Software\UISS\Status",
"String")
Select Case
LCase(UISS_Status$)
Case
"uiss terminated!"
'
'place here your code if UISS is not active if needed, or close
your module when UISS closes
'
Case
"uiss running, but no agwpe!"
'
'place here your code if UISS is running but without AGWPE if
needed
'
Case
"uiss server active!"
'
'place here your code if UISS server is running normal, if needed
'
Case
"<<uiss not running or uiss server mode not
active!>>"
'
'place here your code if UISS is not running
'
End Select
End Sub
Private Sub Form_Load()
'
'UISS client example, de ON6MU
'To be used as UISS module (add-on)
'
'Need UISS v3.3 or later to work!
'UISS needs to be setup as a server
'
'If UISS is running as a server you'll
see a small '+' above the logo
'or look in the About box. There
you'll see "Server Active"
'You can set UISS in an experimental
server mode to test
'your uiss-module. You can do this by
changing the UISS.INI
'and look for the line [UISS Server]
and change the value
'under that line to 1
'To disable the server mode set it
back to 0
'When UISS is terminated (closed down)
then you'll get 'UISS Terminated!' in the registry
'When UISS is running but no AGWPE is
found then you'll get UISS Running, but no AGWPE!'
'
'This source code example demonstrates
how to read
'the raw packet data parsed to the
registry by UISS
'acting as a server.
'Place a text-box and a timer on your
form and paste this code
'Check if UISS sees you as a valid
UISS module
registered module only'
'Initialize
'set timer
interval to 250 ms (scans 4 times a second for data)
Timer1.Interval
= 250
'enable
timer to begin reading the UISS packet data from the registry
Timer1.Enabled
= True
'Check if UISS
Server is active, and if AGWPE is active, or UISS has closed down
Call CheckStatus
End Sub
Private Sub Text1_Change()
'
'protect
Text1 from becoming to large
'
If
Len(Text1) > 32000 Then Text1 = Right$(Text1, 27000)
End Sub
Private Sub Timer1_Timer()
'The packet data is raw, as received
by AGW Packet Engine
'and parsed to the UISS Client via
UISS acting as a server
'&h0d is de end-limiter of a
packet frame
'use this value to separate the header
from the data
'In this example the received packet
data is not formatted
'
'Read UISS
packet data received (header and data)
UISS_RX_Packet
= getstring(HKEY_CURRENT_USER, "Software\UISS\RXData",
"String")
'check if data has already been read
and put it in Text1
'You could also delete the key value
instead of checking,
'but deleting the last entry could
result that nother
'UISS modules (addons) can't read the
last value, because
'your addon erased it.
'The function 'DeleteValue' deletes
the last value
'
'We use a
simple comparison to be sure
If
UISS_RX_Packet <> UISS_RX_Packet_Read Then
Text1 = Text1 +
UISS_RX_Packet & vbCrLf
End If
'scroll
Text1
Text1.SelStart
= Len(Text1)
'store last
receive packet
UISS_RX_Packet_Read
= UISS_RX_Packet
'you could also
check the STATUS of UISS continue
'Call CheckStatus
End Sub
The complete and more advanced program can be ordered by mail too.
With this simple VB source code youll should be able to program a UISS module once you get the hang of how it works. Because of all the data UISS receives is passed through your application you can do with the packet strings anything you like without programming a complicated AGW DLL to do the same.
If interest occurs in this UISS feature
(modules as an add-on) then Ill could consider adding
TX-capabilities too. Nevertheless, with reading the received
packet-frames you can do a lot.
What are the features that your UISS
modules can utilize?
Information of how to add your module to
UISS (registered and so unique, and its free too) can be
done by mailing me. Please send as much info as you can about
your module and/or include your module in a zip-file. If found to
be ok, then your module will be placed on the UISS website for
others to download. Your module will be recognized as a validated
UISS module.
There is one unregistered port to experiment
with before you mail your request for the definitive key (but
only one module can be added).
Setting up your experimental module to
be plugged into UISS
Create a file with NotePad (Microsoft)
called UISSAddOn0.bin
Enter on the first line the key: 0unreg
On the second line your module name (this
will be seen in the UISS module menu): My UISS Module Menu Name
And finally on the 3th line the filename of
your module: My UISSModuleName.EXE
Save the file and run UISS. Youll see
the menu UISS Modules. There youll find your module. Click
on it to run.
In the experimental mode you cant use
all options described above.
You can set UISS in and experimental Server
Mode by editing the UISS.INI file.
Look for the topic [UISS Server] and change
the value beneath it to 1
Set it back to 0 will disable the Server
Mode.
UISS Module file example:
0unreg
My UISS Module Name
My_UISS_Module.exe
Some examples (or ideas) of UISS
modules that could be made:
Important:
I can not be held responsible for any
damage, losses of data or failures resulting out of the use of
3th party UISS modules!
Everything described here needs UISS v3.3 or
higher.
Use picture(s) as auto picture load
UISS can load any picture (JPG, GIF or BMP)
from anywhere on your HD using a automated interval.
This feature could be used from 3th party
programs that saves pictures on your HD on regular intervals,
like sat trackers, aprs maps, webcam, pics from the web etc
It could also be used for demonstration
purposes (slideshows etc.)
The size of the picture does not matter
because UISS resizes the loaded pic to fit the empty space on the
upper right corner of the program (to use the exact proportions
look above)
How it works:
When enabled (in Setup menu and in the
uiss.ini file) UISS will look at the path entered in the uiss.ini
file and load the picture every 20 seconds (default interval). It
will place the found picture in the right corner. Be sure you
have at least 800x600 screen resolution and UISS is in full
screen mode.
You can set the interval in the UISS.INI
file. The value used is in milliseconds (1000 = 1 second).
Anything between 1000 and 64000 ms can be set. The default
interval is 20000 ms (20 seconds).
Place in the UISS.INI the path including the
filename of the picture (jpg, gif, bmp) under
[RefreshPicLoadPath].
Example:
[RefreshPicLoadPath]
C:\DEMONSTRATION\AUTOSAVE\PICTURE.JPG
If you want to use another interval then 20
seconds you should change the value in the UISS.INI under
[PicRefreshInterval]. The value is in milliseconds. Valid are:
1000
.64000. When using 1 no interval is used (UISS
will load that pic once and never looks again if the picture is
changed, so it works like a normal picture background)
Example:
[PicRefreshInterval]
10000
This option Note: Works with version 3.3.1
or higher
Tip: Sebastian, the author of the excellent
cardware satellite tracking program Orbitron have let me know he
would implement such a feature in his next update! This will
allow you to view the passes (calculated by Orbitron) within UISS
realtime. Please check out his website at www.stoff.pl
I can not be held responsible for any 3th
party add-ons nor UISS and use the program at your own risk. We
can not held responsible for any damage or failures to your
system.
.
Click here to
go to the UISS Homepage
Click here to go to
ON6MUs homepage