ArrayArrayArray BrainModular BrainModular Users Forum 2018-08-19T16:17:31+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/6260 2018-08-19T16:17:31+02:00 2018-08-19T16:17:31+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6260&p=40092#p40092 <![CDATA[How to retrieve value entered in ptIpAddress ?]]>
apparently, you are right : Usine considers an IP address to be one int rather than four bytes.

I have solved my problem by using sdkGetEvtDataAddr function like this :

Addr=(unsigned int*)sdkGetEvtDataAddr (IPAddrEvent);
IP=htonl(*Addr);

and now it works like a charm, I am able to receive the IP address entered on the patch

Benoit

Statistics: Posted by imodularsynth — 19 Aug 2018, 16:17


]]>
2018-08-19T12:47:46+02:00 2018-08-19T12:47:46+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6260&p=40091#p40091 <![CDATA[How to retrieve value entered in ptIpAddress ?]]> when trying from the osc_receive module ip pin, it says flow type 3, wich is same as purple floats, the 4byte of float are an event of size 1.
if man put a color on the ip, the 4bytes are 255 255 255 255 for full rgba and so is the ip.

didn't try in sdk but what is strange is sdkGetEventData should work then . pers i never set the pParamInfo->EventPtr = &IPAddrEvent; thing
if have a UsineEventPtr my_param; in the .h, and set it in the onSetEventAddress(int ParamIndex, UsineEventPtr pEvent)
switch (ParamIndex)
{
case 0:my_param = pEvent; break;
...
like the provided examples
dk if that could be the cause of the problem...

Statistics: Posted by 23fx23 — 19 Aug 2018, 12:47


]]>
2018-08-19T12:04:57+02:00 2018-08-19T12:04:57+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6260&p=40090#p40090 <![CDATA[How to retrieve value entered in ptIpAddress ?]]>
I am writing a module on which there is a ptIpAddress input. When I enter a new IP address on the patch, the callback is called correctly, but I am unable to retrieve the IP address, I always get 0.

Moreover, sdkGetEvtSize returns 1, which sounds strange (I was expecting 4, since there are four bytes)

sdkGetEvtData() returns 0 whatever I enter in Usine
Same result with sdkGetEvtArrayData (IPAddrEvent, 0);

The input is declared like this, so I think it's correct :

pParamInfo->ParamType = ptIpAddress;
pParamInfo->Caption = "IP";
pParamInfo->IsStoredInPreset = TRUE;
pParamInfo->IsInput = TRUE;
pParamInfo->IsOutput = FALSE;
pParamInfo->CallBackType = ctImmediate;
pParamInfo->EventPtr = &IPAddrEvent;

Anybody having an idea about the way to retrieve the IP address entered ?

Thanks

Benoit

Statistics: Posted by imodularsynth — 19 Aug 2018, 12:04


]]>
BrainModular BrainModular Users Forum 2018-08-19T16:17:31+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/6260 2018-08-19T16:17:31+02:00 2018-08-19T16:17:31+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6260&p=40092#p40092 <![CDATA[How to retrieve value entered in ptIpAddress ?]]>
apparently, you are right : Usine considers an IP address to be one int rather than four bytes.

I have solved my problem by using sdkGetEvtDataAddr function like this :

Addr=(unsigned int*)sdkGetEvtDataAddr (IPAddrEvent);
IP=htonl(*Addr);

and now it works like a charm, I am able to receive the IP address entered on the patch

Benoit

Statistics: Posted by imodularsynth — 19 Aug 2018, 16:17


]]>
2018-08-19T12:47:46+02:00 2018-08-19T12:47:46+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6260&p=40091#p40091 <![CDATA[How to retrieve value entered in ptIpAddress ?]]> when trying from the osc_receive module ip pin, it says flow type 3, wich is same as purple floats, the 4byte of float are an event of size 1.
if man put a color on the ip, the 4bytes are 255 255 255 255 for full rgba and so is the ip.

didn't try in sdk but what is strange is sdkGetEventData should work then . pers i never set the pParamInfo->EventPtr = &IPAddrEvent; thing
if have a UsineEventPtr my_param; in the .h, and set it in the onSetEventAddress(int ParamIndex, UsineEventPtr pEvent)
switch (ParamIndex)
{
case 0:my_param = pEvent; break;
...
like the provided examples
dk if that could be the cause of the problem...

Statistics: Posted by 23fx23 — 19 Aug 2018, 12:47


]]>
2018-08-19T12:04:57+02:00 2018-08-19T12:04:57+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6260&p=40090#p40090 <![CDATA[How to retrieve value entered in ptIpAddress ?]]>
I am writing a module on which there is a ptIpAddress input. When I enter a new IP address on the patch, the callback is called correctly, but I am unable to retrieve the IP address, I always get 0.

Moreover, sdkGetEvtSize returns 1, which sounds strange (I was expecting 4, since there are four bytes)

sdkGetEvtData() returns 0 whatever I enter in Usine
Same result with sdkGetEvtArrayData (IPAddrEvent, 0);

The input is declared like this, so I think it's correct :

pParamInfo->ParamType = ptIpAddress;
pParamInfo->Caption = "IP";
pParamInfo->IsStoredInPreset = TRUE;
pParamInfo->IsInput = TRUE;
pParamInfo->IsOutput = FALSE;
pParamInfo->CallBackType = ctImmediate;
pParamInfo->EventPtr = &IPAddrEvent;

Anybody having an idea about the way to retrieve the IP address entered ?

Thanks

Benoit

Statistics: Posted by imodularsynth — 19 Aug 2018, 12:04


]]>