Создать ответ 
 
Рейтинг темы:
  • Голосов: 0 - Средняя оценка: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Modem using post to an API!
Автор Сообщение
NeoSnk Не на форуме
Новичок
*

Сообщений: 8
Зарегистрирован: 29.06.2016
Рейтинг: 0
Сказал спасибо: 7
Поблагодарили 0 раз(а) в 0 сообщ.
Сообщение: #1
Modem using post to an API!
Hello guys, I want to do a test with the Dreamcast Modem. I learned about the BlueCrab ppp.h in KallistiOS, and I'm able to make the Modem Dial and also ping an IP. I'd like to know if it is possible to ping a PHP URL using the post method where I'm going to send some parameters, example:

http://www.mytext.com?name=dreamcast&age=21

I'm using this code:

#include <stdio.h>
#include <kos/dbglog.h>

#include <arch/arch.h>

#include <ppp/ppp.h>
#include <kos/net.h>

KOS_INIT_FLAGS(INIT_DEFAULT | INIT_NET);

int main(int argc, char *argv[]) {
int i;

ppp_init();

i = ppp_modem_init("12", 1, NULL);
if(i < 0)
return 0;

ppp_set_login("dream", "cast");
i = ppp_connect();

if(i == -1) {
printf("Link establishment failed!\n");
return 0;
}

printf("Pinging the other side of the link (%d.%d.%d.%d)\n",
net_default_dev->gateway[0], net_default_dev->gateway[1],
net_default_dev->gateway[2], net_default_dev->gateway[3]);

for(i = 0; i < 10; ++i) {
net_icmp_send_echo(net_default_dev, net_default_dev->gateway, 1234, i,
NULL, 0);
thd_sleep(500);
}

printf("Pinging sylverant.net (67.222.144.120)\n");
for(i = 0; i < 10; ++i) {
uint8 addr[4] = { 67, 222, 144, 120 };
net_icmp_send_echo(net_default_dev, addr, 1234, i, NULL, 0);
thd_sleep(500);
}

ppp_shutdown();
return 0;
}

I tried to created a method: https://stackoverflow.com/questions/2207...e-response

But I didn't get it working. Any input or directions would be welcome, thanks a lot.
(Последний раз сообщение было отредактировано 02.03.2021 в 23:03, отредактировал пользователь NeoSnk.)
02.03.2021 23:02
Найти все сообщения Цитировать это сообщение
Создать ответ 


Сообщения в этой теме
Modem using post to an API! - NeoSnk - 02.03.2021 23:02

Похожие темы
Тема: Автор Ответов: Просмотров: Посл. сообщение
  USB Modem Voltage Inducer for Dreamcast aldair 0 5554 08.01.2020 19:12
Посл. сообщение: aldair
  My very first post. Turbokat 2 9954 29.04.2017 14:09
Посл. сообщение: Turbokat
  My first forum post tossEAC 4 16955 03.04.2017 00:33
Посл. сообщение: tossEAC
  Dreamcast DC-PC (FAX MODEM USB): 4X4 Evolution online 100% aldair 0 7260 27.08.2015 20:04
Посл. сообщение: aldair
  Moband Adapter ( Dreamcast modem broadband replacement band ) aldair 1 13811 24.05.2014 21:21
Посл. сообщение: cybdyn
  Connecting to the Internet via USB Modem Dreamcast in emulating win98 win7 aldair 0 6960 16.10.2013 16:55
Посл. сообщение: aldair

Переход:


Пользователи просматривают эту тему: 2 Гость(ей)