share structure through memory sharing C to php - Raspberry Pi Forums


hi,
i've found code share data between c application , php webserver.
http://www.raspberry-projects.com/pi/pr ... web-server
on c application structure passed shared memory

code: select all

shared_memory = (struct structdata *)shared_memory_pointer;
structure

code: select all

struct actualconfig { 	char name[15]; 	char version[10];	 	float valfloat[10]; 	unsigned char state;	 };
on php code data in array.
don't know how transform array struct.
found on web subject serialization don't know how use it.

help

i suggest making array of strings send on instead of c-struct.
don't have decode how floating point numbers stored in memory, print numbers array of strings should more simpler parse.


raspberrypi



Comments