Still stupid questions.. I hate to do it, and I
really appreciate your patience (so far)..
The first more complex xsub I need, now looks like this
(it's not terribly good, nor functional.. also some bad
comment added):
int
dx_playf(chdev, fnamep) /* must put tpt here, and am .still. not clear
+ */
int chdev
char *fnamep
PREINIT:
DV_TPT tptmp[2];
CODE:
/* Will the constants below be worked out of the
headers, which are included above in the XS?
I've seen lots of ways of getting them to Perl,
but perl does not need them */
tpt[0].tp_type = IO_CONT; /* the next entry is next on arr
+ay */
tpt[0].tp_termno = DX_IDDTIME; /* Interdigit Delay */
tpt[0].tp_length = 2;
tpt[0].tp_flags = TF_IDDTIME;
tpt[1].tp_type = IO_EOT; /* last entry */
tpt[1].tp_termno = DX_MAXDTMF; /* Maximum digits to get from ca
+ller */
tpt[1].tp_length = 1;
tpt[1].tp_flags = TF_MAXDTMF;
RETVAL = dx_playf(chdev, fnamep, tptmp, 0);
OUTPUT:
RETVAL
The DX_TPT struct is defined in the header:
typedef struct DV_TPT {
unsigned short tp_type; /* Flags describing t
+his entry */
unsigned short tp_termno; /* Termination Parame
+ter number */
unsigned short tp_length; /* Length of terminat
+or */
unsigned short tp_flags; /* Parameter attribut
+e flag */
unsigned short tp_data; /* Optional additiona
+l data */
unsigned short rfu; /* Reserved
+ */
DV_TPT *tp_nextp; /* Pointer to next te
+rmination TPT */
}DV_TPT;
and info on all the mad things I must still do with the DV_TPT at
http://support.dialogic.com/documentation/unix/SR50_linux/html_files/vox_api/0009c-07-163.html#P18891_490358
This also doesn't have the code to make and destroy memory..
These are the things I still must learn, if I do disclose
my experience by other means than my PM experience points..
I envisage wrapping the lot, so I need to make a setter for
each type (no need for a getter, it's just for passing args
in), correct? I have a problem now that all the simpler
functions are failing. -1, and $! = Invalid Argument.
the xsubs are:
int
dx_open(chdev, mode)
const char * chdev
int mode
int
dx_close(dev)
int dev
int
dx_sethook(chdev, hookstate, mode)
int chdev
int hookstate
unsigned short mode
and the following lines in test.pl:
$chdev = Starla::dx::dx_open("dxxxB1C1",0) or die "Cannot open dxxxB1
+C1 ($!)\n";
print "Device is $chdev ($!), state is ";
$tmp = Starla::dx::ATDX_STATE($chdev);
print "$tmp ($!)\n";
returns:
Device is -1 (Invalid argument), state is -1 (Invalid argument)
At this point I wonder how I even managed to do this under
some software package under Windows NT. This is about as
complex as I will need to get, and feeling like even that's
skew.
Thanks again.. problem is probably due to a bit of a lack
of sleep, which I plan to do now.
THis is a learn for me, but if I can make it well enough,
not only will I run my server using this extension, I also
want to make it my first CPAN module
|