Porting CAPI Structure Problem

Everything else that doesn't fall into one of the other PB categories.
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Porting CAPI Structure Problem

Post by Tranquil »

Hi All!

I'm on it to port the CAPI2032.dll to a userlib for PB to receive messages of incoming calls and to create a little CIT system for my applications.

In fact it works but I'm having a little bit of touble by porting the structures to PB.

That is what the capi reference says to the definition of types:

Code: Select all

• byte 8bit value, coded as one octet
• word 16bit value, coded as two contiguous octets, least significant first
• dword 32bit value, coded as two contiguous words, least significant first
• qword 64bit value, coded as two contiguous dwords, least significant first
• struct coded as an array of octets, the first octet containing the length of the subsequent array.
If the first octet has the value 255 (0xFF), this is an escape code: the following
word is then interpreted as containing the length of the following data. An empty
struct is coded as a single octet with value 0.
I tries to convert the LISTEN_REQ Structure that is defined that way:

Controller dword
Info mask dword Bit field, coding as follows:
[0]: Cause
[1]: Date/time
[2]: Display
[3]: User-user information
[4]: Call progression
[5]: Facility
[6]: Charging
[7]: Called party number
[8]: Channel information
[9]: Early B3 connect
[10]: Redirecting/redirection information
[11]: reserved
[12]: Sending Complete
[13 to 31]: reserved
CIP Mask dword explained below
CIP Mask 2 dword reserved for additional services
Calling party number struct Calling party number
Calling party subaddress struct Calling party subaddress


What the hell do their mean with struct!? I dont know how to define it within a PB structure. Someone can help?

Thanks!

Mike
Tranquil
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

you cannot put it in a structure, as fields are dynamic, ie. they describe the length of the upcoming data

this is a very common format in telecomms land... applications / hardware checks data, tries to process what it recognizes and passes on what it doesn't... as data length is passed before the data itself, it can be passed on with less effort

struct won't help here...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

That is exactly that what I thought. Okay, then there is no other way to Peek the needed datas from memory. Thats for quick answer!

Mike
Tranquil
Max.
Enthusiast
Enthusiast
Posts: 225
Joined: Fri Apr 25, 2003 8:39 pm

Post by Max. »

Tranquil wrote:That is exactly that what I thought. Okay, then there is no other way to Peek the needed datas from memory. Thats for quick answer.
Did you make progress on this? Would come handy now!
Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i'll be working on this as well later on, first gotta complete the move (changed house, brrrr, no fun :-( )
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply