SIM808.cpp

Hi All,
I'm a real newbie and I'm trying to modify the sim808 library.

While I don't have problems to read the code there is only this point that is real obscure to me:

Stream *serialSIM808 = NULL;

void sim808_init(void * uart_device, char num)
{
if(num)
serialSIM808 = (HardwareSerial*)uart_device;
else
serialSIM808 = (SoftwareSerial*)uart_device;
}

Can you please help me to understand it?
Thanks

Can you please help me to understand it?

What is hard to understand? The code takes a pointer to a serial object, and a number that defines whether the serial object is a software serial object or a hardware serial object.

It performs an appropriate cast, based on the type.

Both types derive from Stream, so the casts are possible, and logical.

What a stuppid man I am.
Yes, it is clear now.
Thank you for the help.