0% found this document useful (0 votes)
48 views2 pages

Get SMS Ardouino Nokia3310

This code defines constants and variables for communicating with a device over a serial connection at 115200 baud. It includes an array of bytes to send a GET SMS MESSAGE command and initializes the serial connection. In setup, it sends sync bytes and the GET SMS MESSAGE command. In loop, it continuously reads incoming serial data and prints it in hexadecimal.

Uploaded by

Adel BL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views2 pages

Get SMS Ardouino Nokia3310

This code defines constants and variables for communicating with a device over a serial connection at 115200 baud. It includes an array of bytes to send a GET SMS MESSAGE command and initializes the serial connection. In setup, it sends sync bytes and the GET SMS MESSAGE command. In loop, it continuously reads incoming serial data and prints it in hexadecimal.

Uploaded by

Adel BL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#define FBUS_TRANSMIT_MAX_LENGTH 256

#include <SoftwareSerial.h>
#define BAUD 115200

byte msg[] = {
// 0x1E, 0x00, 0x0C, 0xD1, 0x00, 0x07, 0x00, 0x01, 0x00, 0x03, 0x00,
0x01, 0x60, 0x00, 0x72, 0xD5 }; // GET HW/SW
//
0x1E,0x00,0x0C,0x02,0x00,0x08,0x00,0x01,0x00,0x07,0x02,0x01,0x01,0x64,0x11 ,
0x69 }; //GET SMS MESSAGE
// s Get SMS message { 0x0007, 0x02, location,
0x01, 0x64, CHEKSUM_EVEN , CHEKSUM_ODD}

byte call[] =
{0x1E,0x00,0xc,0x01,0x00,0x11,0x00,0x01,0x00,0x01,0x01,0x00,0x32,0x05,0x01,0x05,0x0
0,0x02,0x00,0x00,0x01,0x01,0x45,0x00,0x78,0x13};

//hang up
byte Hangup
[]={0x1E,0x00,0x0C,0x01,0x00,0x07,0x00,0x01,0x00,0x08,0x60,0x01,0x63,0x00,0x11,0x0E
};

void setup() {
// initialize the pushbutton pin as an input:
// pinMode(buttonPin, INPUT);
// Initialise the F-bus
Serial.begin(BAUD);
delay(100);
pinMode(LED_BUILTIN, OUTPUT);
for (int z = 0; z < 128; z++) {
Serial.write(0x55);
}
Serial.println(" ");
delay(100);

// read the state of the pushbutton value:


// buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed. If it is, the buttonState is HIGH:


// buttonState = digitalRead(buttonPin);
// if(buttonState == HIGH)
// {
// // Send our command
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second

delay(100); // wait for a second


for (int x = 0; x < (sizeof(msg) / sizeof(byte)); x++)
// for (int x = 0; x < 16; x++)
{
Serial.write(msg[x]);
}
Serial.println(" ");
Serial.println(" we reciev from phone");
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second

//

void loop() { updateSerial();


}

void updateSerial()
{
while (1) {
delay(100);

while (Serial.available() > 0) {


int incomingByte = Serial.read();

Serial.print(incomingByte, HEX);
Serial.print(" ");

// while (Serial.available())
// {
// phone.write(Serial.read());//Forward what Serial received to Software Serial
Port
// }
// while(phone.available())
// {
// Serial.write(phone.read());//Forward what Software Serial received to Serial
Port
}
}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy