# Cellron Kütüphane Kullanımı

#### 1- atCommands

EC25'e istediğim AT komutlarını gönderebilmek ve aldığımız cevabı yorumlamak için gerekli fonksiyonlar bu sınıf içinde tanımlanmıştır.

**atCommands(HardwareSerial \*\_modem, HardwareSerial \*\_pc)**

EC25'i initialize etmek için kullanılır.

| Parametre | Tip              | Açıklama                                                      |
| --------- | ---------------- | ------------------------------------------------------------- |
| `_modem`  | `HardwareSerial` | EC25'in bağlı olduğu serial port                              |
| `_pc`     | `HardwareSerial` | Debug çıktılarını alacağınız cihazın bağlı olduğu serial port |

**int sendCommand(String \*command, String \*response);**

EC25'e AT komutlarını göndermek için kullanılır.

| Parametre  | Tip      | Açıklama                                                      |
| ---------- | -------- | ------------------------------------------------------------- |
| `command`  | `String` | Gönderilecek Komut                                            |
| `response` | `String` | Debug çıktılarını alacağınız cihazın bağlı olduğu serial port |
| `return`   | `int`    | Gelen cevabın kategorisi \[1]                                 |

**int sendCommand(String \*command);**

EC25'e AT komutlarını göndermek için kullanılır. (Cevap yollanmaz)

| Parametre | Tip      | Açıklama                      |
| --------- | -------- | ----------------------------- |
| `command` | `String` | Gönderilecek Komut            |
| `return`  | `int`    | Gelen cevabın kategorisi \[1] |

**void listenPost();**

EC25'den dönen cevaplar bitiş verisi gelene kadar dinlenir.

{% hint style="info" %}
\###2- LTE LTE kullanarak haberleşmek için kullanılan sınıf. ####LTE(HardwareSerial \*\_modem, HardwareSerial \*\_pc) LTE'yi initialize eder.
{% endhint %}

| Parametre | Tip              | Açıklama                                                      |
| --------- | ---------------- | ------------------------------------------------------------- |
| `_modem`  | `HardwareSerial` | EC25'in bağlı olduğu serial port                              |
| `_pc`     | `HardwareSerial` | Debug çıktılarını alacağınız cihazın bağlı olduğu serial port |

**void test();**

Modül testi için SMS test fonksiyonu

**void activatePDP();**

İnternet bağlantısını sağlamak için gerekli ayar fonksiyonu

**bool ping(String addr);**

İstenilen adrese ping atılır.

| Parametre | Tip      | Açıklama              |
| --------- | -------- | --------------------- |
| `addr`    | `String` | Ping atılacak adres   |
| `return`  | `bool`   | Ping başarılı oldu mu |

**bool sendHttpsReq(String addr, String \*request);**

İstenen adrese HTTPs isteği yollanır

| Parametre | Tip      | Açıklama                 |
| --------- | -------- | ------------------------ |
| `addr`    | `String` | Bağlantı kurulacak adres |
| `request` | `String` | Gönderilecek HTTPs body  |
| `return`  | `bool`   | İstek başarılı oldu mu   |

### Örnek Kod:

```arduino
#include <Arduino.h>
#include "EC25.h"

void setup() {
   Serial.begin(9600);
   EC25::LTE EC25Dev(&Serial2,&Serial);

  pinMode(5, OUTPUT);
  Serial.println("Setup");
  delay(3000);
  
  String text;
  EC25Dev.ping("google.com"); //Google'a ping atılır
  delay(1000);
  String addr = "oguzkagandeneme-fde40-default-rtdb.firebaseio.com"; //Verinin gönderileceği adres
  String data = "{ \"asd\" : \"asd\"}"; //Gönderilecek veri
  String path = "/in.json"; //Gönderilecek yol
  EC25Dev.sendHttpsReq(addr+path,&data);
}
```

{% embed url="<https://github.com/OguzkaganSavunmaTeam/Cellron>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://teleron.gitbook.io/dashboard/fundamentals/yazilim/modulun-programlanmasi/cellron-kutuphane-kullanimi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
