Problems on serial.read()

Beacon Service::converteStringParaBeacon(String msg) {
	int c, i;
	short vet[3];
	Beacon beacon;
	for (c = i = 0; c < 3; c++) {         [b]  // If I put c<3 and not c<2 it get worst [/b]
		vet[c] = (short) msg.substring(i, msg.indexOf('#', i)).toInt();
		i = msg.indexOf("#", i) + 1;
	}

	beacon.setDhost(vet[0]);
	beacon.setShost(vet[1]);
	beacon.setSALTO(vet[2]);
		
	return beacon;
}

Look at the picture!!! At leat with C<2 I still get in the midle of garbage 2#1#0# ahuahuahah

But, I thank you so much for help. Please, stay with me! :slight_smile: