Comments (7)
endian-agnostic decoders seem to work for regular numbers. Inf/Nan/etc missing but that's a simple 4/8-byte pattern matching issue. Has anybody got an idea for endian-agnostic decoders?
from open62541.
ahm, just an idea, why not using htonl and htonf functions to convert to big-endian and then work with that order? (a htonf is here: http://stackoverflow.com/a/10621440/383834)... using network functions we will not have to rely on compiler switches
from open62541.
@stasik: you mean something like
union { UA_Byte i[8]; double d; } tmp;
tmp.d = htonf(value); // convert to standard network big endian
dst[*pos+0] = tmp.i[7]; ...; dst[*pos+7] = tmp.i[0]; // and eventually to opc ua's little endian
from open62541.
Hmmmm.... seems not to be very elegant...
Am 08.04.2014 um 20:16 schrieb uleon [email protected]:
@stasik: you mean something like
union { UA_Byte i[8]; double d; } tmp;
tmp.d = htonf(value); // convert to standard network big endian
dst[_pos+0] = i[7]; ...; dst[_pos+7] = i[0]; // and eventually to opc ua's little endian
—
Reply to this email directly or view it on GitHub.
from open62541.
Why not let the precompiler deal with it? Autoconf has AC_C_BIGENDIAN. So we can set our own flag without relying on some nonstandard compiler extension.
Just 4 ifdef/ifndef/endifs around the numeric types and every architecture becomes as fast as possible.
from open62541.
I'd like to suggest to call the decoders of UA_UInt32 and UA_UInt64 with a casted pointer. This would work for all architectures that have IEEE745-floats with biased exponents in the same byte order as their ints. PDP would be out at the moment which I consider no problem because I've run out of 8"floppy disks as well.
from open62541.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from open62541.
Related Issues (20)
- Basic256Sha256 security failed returns BadSecurityChecksFailed HOT 3
- Published json via MQTT is mixed up HOT 5
- Several properties missing for ObjectTypes in reduced nodeset HOT 2
- Inconsistent Types When Using Types From Namespaces Other Than UA
- why clientHandle was revised when I call UA_Client_MonitoredItems_createDataChanges? HOT 2
- Dead Lock in A&C example tutorial_server_alarms_conditions.c HOT 3
- CMake function ua_generate_nodeset_and_datatypes does not handle multiple NodeSet2 files
- Questions about the TSN examples (broken for build ?) HOT 3
- Creating a session HOT 2
- Server rejects ActivateSession with NULL userIdentityToken.
- PubSub UDP - unicast subscriber not listening on all interfaces. HOT 2
- DataType handling need upgrade to OPC UA 1.04 and newer.
- Allow custom definition of UA_FLOAT_IEEE754 HOT 3
- open62541-examples compilation on master branch fails with Permission denied
- TCP_registerListenSockets before interface is available
- PubSub: Sending NULL values in dataSetMessages with rawData field encoding crashes the application HOT 1
- PubSub: freed memory is accessed during writerGroup removal HOT 3
- nodeset_compiler keeps crashing
- Unable to run PubSub MQTT with TLS HOT 1
- `UA_Client_MonitoredItems_modify_async` should modify internal state? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open62541.