src/VirtualShield.cpp
/// <summary>
/// Begins a service write operation to the communication channel. Increments a message id, includes and returns the id.
/// </summary>
/// <param name="serviceName">Name of the service.</param>
/// <returns>The new id of the message or a negative error..</returns>

Begins a service write operation to the communication channel. Increments a message id, includes and returns the id.

Name of the service.
The new id of the message or a negative error..
Begins a service write operation to the communication channel . Increments a message id includes and returns the id . Name of the service . The new id of the message or a negative error ..
int VirtualShield::beginWrite(const char* serviceName)  
{
	int id = nextId++; 
	if (nextId < 0) 
	{
		nextId = 1;
	}
	if (sendFlashStringOnSerial(MESSAGE_SERVICE_START) != SERIAL_SUCCESS) return SERIAL_ERROR;
	if (sendFlashStringOnSerial(serviceName) != SERIAL_SUCCESS) return SERIAL_ERROR;
	if (sendFlashStringOnSerial(MESSAGE_SERVICE_TO_ID) != SERIAL_SUCCESS) return SERIAL_ERROR;
	_VShieldSerial->print(id);
#ifdef debugSerial
	Serial.print(id);
#endif
	return id;
}
int VirtualShield :: beginWrite ( const char * serviceName ) { int id = nextId ++ ; if ( nextId < 0 ) { nextId = 1 ; } if ( sendFlashStringOnSerial ( MESSAGE_SERVICE_START ) != SERIAL_SUCCESS ) return SERIAL_ERROR ; if ( sendFlashStringOnSerial ( serviceName ) != SERIAL_SUCCESS ) return SERIAL_ERROR ; if ( sendFlashStringOnSerial ( MESSAGE_SERVICE_TO_ID ) != SERIAL_SUCCESS ) return SERIAL_ERROR ; _VShieldSerial -> print ( id ) ; #ifdef debugSerial Serial . print ( id ) ; #endif return id ; }
<summary>
Begins a service write operation to the communication channel.
<summary > Begins a service write operation to the communication channel .
//let's stay positive