Hirdetés

Új hozzászólás Aktív témák

  • Szita1

    tag

    Sziasztok, egy kicsit elakadtam, egy kódsorban, azt szeretném, hogy a linkről érkező számsort küldené el :

    myswitch.send(filename, 32);

    a monitorra kiírja, de a myswitchbe beillesztve nem jó.

    hibát ír ki: invalid conversion from 'char*' to 'long unsigned int'

    Mi lehet a probléma? Tudtok segíteni? itt a teljes kód.

    #include <SPI.h>
    #include <SdFatUtil.h>
    #include <Ethernet.h>
    #include <RCSwitch.h>
    #include <RemoteTransmitter.h>
    #include <stdio.h>
    #include <stdint.h>
    #include <Wire.h>
    byte mac[] = {
    0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEE };

    byte ip[] = {
    192, 168, 1, 200 };
    EthernetServer server(80);

    #define BUFSIZ 70

    String querystring;

    RCSwitch RCSend = RCSwitch();

    boolean Redirect = false;

    char BUFFER[BUFSIZ];

    char clientline[BUFSIZ];
    unsigned long code;
    char *filename;
    RCSwitch mySwitch = RCSwitch();
    RemoteTransmitter tele = RemoteTransmitter(10,125,8);
    void setup() {

    Serial.begin(9600);

    PgmPrintln("-start begin-");
    mySwitch.enableTransmit(10);
    mySwitch.setProtocol(2);
    pinMode(10, OUTPUT);
    digitalWrite(10, HIGH);
    Ethernet.begin(mac, ip);
    server.begin();
    RCSend.enableReceive(0);
    PgmPrintln("-start finish-");
    PgmPrint("Free RAM: ");
    Serial.println(FreeRam());
    }

    void loop()
    {
    int index = 0;



    EthernetClient client = server.available();

    if (RCSend.available()) {
    Serial.println(RCSend.getReceivedValue());

    if (RCSend.getReceivedValue() == 0){
    RCSend.resetAvailable();
    }

    else{
    RCSend.resetAvailable();
    }
    }
    if (client) {
    PgmPrint("Free RAM: ");
    Serial.println(FreeRam());
    boolean current_line_is_blank = true;
    index = 0;
    while (client.connected()) {
    if (client.available()) {
    char c = client.read();
    if (c != '\n' && c != '\r') {
    clientline[index] = c;
    index++;
    if (index >= BUFSIZ)
    index = BUFSIZ -1;
    continue;
    }
    clientline[index] = 0;

    if (strstr(clientline, "GET /") != 0) {
    if (!filename) filename = clientline + 5;
    (strstr(clientline, " HTTP"))[0] = 0;


    if (strstr(filename, "restart") != 0){
    client.println("Restart");
    }

    Serial.println(filename);

    mySwitch.send(filename,32);


    delay(1000);
    //tele.sendTelegram(code,10);


    client.stop();



    break;
    }
    }
    break;
    }
    }
    delay(100);
    client.stop();
    if (strstr(filename, "restart") != 0 || strstr(filename, "chgIP") != 0){
    asm volatile (" jmp 0");
    }
    }

    [ Szerkesztve ]

Új hozzászólás Aktív témák