Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
31 user(s) are online (15 user(s) are browsing Forums)

Members: 1
Guests: 30

TheMagicSN, more...

Support us!

Headlines

Forum Index


Board index » All Posts (elfpipe)




Re: Terminal
Just can't stay away
Just can't stay away


Thanks for the inputs .

Putty seems good, but how can I make it understand that '\n' means newline AND carriage return??

Until this is fixed, I think I will stick with Termite.

EDIT: Nevermind, found the tag called "Implicit CR in every LF". Putty is good to go


Edited by alfkil on 2011/3/26 23:09:48
Go to top


Re: Terminal
Just can't stay away
Just can't stay away


@Chris

I comes with windows? I can't find it there, only this online:

Quote:
HyperTerminal Private Edition 7.0
HyperTerminal Private Edition is a terminal emulation program. Download now
Size: 3.20MB License: Shareware Price: $59.99 By: Hilgraeve, Inc


I found another little neat program called termine, which does pretty much exactly what I wanted it to

Go to top


Terminal
Just can't stay away
Just can't stay away


I have just managed to get a USB to serial adapter to work on my Windoze machine, so that I can receive debug output from my sam-flex. Now the question is: What kind of terminal software do people use? I can only find trial versions of software online, and the software I'm using now ("Serial Port Monitor") reads newlines as dots (and no newline).

Help appreciated.

Go to top


Re: Qt Native News
Just can't stay away
Just can't stay away


@jahc

Qt is stricktly C++. And yes, it is a nice interface . And no, the port is not done yet and probably will not be for a long time...


Interlude: Qt Native News occuring between this post and the next is available at the amigans.net temporary site. Direct link to temporary site thread


Edited by Chris on 2011/4/15 19:53:27
Go to top


Re: Qt Native News
Just can't stay away
Just can't stay away


@afxgroup

The sqlite driver for libQtSql.so is currently working. I haven't worked on any of the other drivers.

@DAX

Hehe, yeah that would be great . Currently I'm still stuck trying to get an exec signal from sockets... And then there is the whole libQtGui thing. Long way to go still.

(NB: sockets are working just fine, only I'm not getting any signals from them, so when downloading data I need a QTimer object to drive the events.)

Go to top


Re: bsdsocket and exec signals
Just can't stay away
Just can't stay away


EDITED:
Maybe someone can help me with this one also:

I'm not sure how to query the connection for data. Code hangs on both read() and IExec->Wait():


Quote:

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include <netdb.h>

#include <proto/exec.h>
#include <proto/bsdsocket.h>

#define MAX_BUF 100

int main(int argc, char* argv[])
{
int sockd;
int count;
struct sockaddr_in serv_name;
char buf[MAX_BUF];
int status;

/* create a socket */
sockd = socket(AF_INET, SOCK_DGRAM, 0);
if (sockd == -1)
{
perror("Socket creation");
exit(1);
}

/* server address */
serv_name.sin_family = AF_INET;
struct hostent *hent = gethostbyname("www.google.com");
if (!hent)
{
perror ("gethostbyname failed");
exit(-1);
}
if (hent->h_addrtype != AF_INET)
{
perror("Unknown address type");
exit(-1);
}

printf("hostname = %s\n", hent->h_name);

//What is supposed to happen here???
//serv_name.sin_addr.s_addr = inet_addr(hent->h_addr_list[0]);
memcpy (&(serv_name.sin_addr.s_addr), hent->h_addr, hent->h_length);
serv_name.sin_port = htons (12345);

/* connect to the server */
status = connect(sockd, (struct sockaddr*)&serv_name, sizeof(serv_name));
if (status == -1)
{
perror("Connection error");
exit(1);
}
printf("connected to server\n");

BYTE socketSignal = IExec->AllocSignal(-1);
uint32 socketSignalMask = 1 << socketSignal;

printf("socketSignalMask = 0x%x\n", socketSignalMask);

ISocket->SocketBaseTags (SBTM_SETVAL(SBTC_SIGEVENTMASK), socketSignalMask, TAG_END);

ULONG temp = FD_ACCEPT | FD_CONNECT | FD_READ | FD_WRITE | FD_ERROR;
setsockopt(sockd, SOL_SOCKET, SO_EVENTMASK, &temp, sizeof(temp));

IExec->Wait (socketSignalMask|SIGBREAKF_CTRL_C);
printf("signal received\n");

count = read(sockd, buf, MAX_BUF);
write(1, buf, count);

close(sockd);

IExec->FreeSignal(socketSignal);
return 0;
}


Edited by alfkil on 2010/11/8 17:16:02
Go to top


Re: bsdsocket and exec signals
Just can't stay away
Just can't stay away


@tboeckel

Ahh... Me dumbass, you smart

Go to top


Re: bsdsocket and exec signals
Just can't stay away
Just can't stay away


@tboeckel

Thanks for the info! Still, I don't quite understand how it is supposed to work:
The "getsockopt()" entry in the docs don't mention anything about SO_EVENTMASK as mentioned in the GetSocketEvents() entry, which makes me a little confused. Could you give an example, maybe??

EDIT: I tried inserting the following line, but it changes nothing:

Quote:
setsockopt(sockets[0], SOL_SOCKET, SO_EVENTMASK, (const void *)&socketSignalMask, sizeof(socketSignalMask));

Go to top


bsdsocket and exec signals [NEW PROBLEM]
Just can't stay away
Just can't stay away


Argh!...

I need to be able to do asynchronous io with sockets using exec signals, but I can't get it to work. The ISocket->SocketBaseTags() should set up bsdlibrary to send exec signals, but the signal never arrives. If you remove the IExec->Wait() statement, the code works of course...

Help!

Quote:

#define DATA1 "test string 1"
#define DATA2 "test string 2"

#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>

#include <proto/exec.h>
#include <proto/bsdsocket.h>

/*
* set_nonblocking(): Set a fd into nonblocking mode.
*/
static int set_nonblocking(int fd)
{
int val;

if((val = fcntl(fd, F_GETFL, 0)) == -1) return -1;
if (!(val & O_NONBLOCK)) {
val |= O_NONBLOCK;
fcntl(fd, F_SETFL, val);
}
return 0;
}

/*
* set_blocking(): Set a fd into blocking mode.
*/
static int set_blocking(int fd)
{
int val;

if((val = fcntl(fd, F_GETFL, 0)) == -1) return -1;
if (val & O_NONBLOCK) {
val &= ~O_NONBLOCK;
fcntl(fd, F_SETFL, val);
}
return 0;
}

/*
* __socketpair_tcp(): Create a socket pipe.
*/
int __socketpair_tcp(int fd[2])
{
int listener;
struct sockaddr sock;
socklen_t socklen = sizeof(sock);
int len = socklen;
int one = 1;
int connect_done = 0;

fd[0] = fd[1] = listener = -1;

memset(&sock, 0, sizeof(sock));

if ((listener = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
goto failed;
}

setsockopt(listener, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one));

if (listen(listener, 1) != 0) {
goto failed;
}

if (getsockname(listener, &sock, (socklen_t *) &socklen) != 0) {
goto failed;
}

if ((fd[1] = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
goto failed;
}

setsockopt(fd[1], SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one));

set_nonblocking(fd[1]);

if (connect(fd[1], (struct sockaddr *) &sock, sizeof(sock)) == -1) {
if (errno != EINPROGRESS) {
goto failed;
}
connect_done = 1;
} else {
connect_done = 1;
}

if ((fd[0] = accept(listener, &sock, (socklen_t *) &len)) == -1) {
goto failed;
}

setsockopt(fd[0], SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(one));

close(listener); listener = -1;
if (connect_done == 0) {
if (connect(fd[1], (struct sockaddr *) &sock, sizeof(sock)) != 0) {
goto failed;
}
}

set_blocking(fd[1]);

/* all OK! */
return 0;

failed:
printf("socketpair failed!\n");
if (fd[0] != -1) close(fd[0]);
if (fd[1] != -1) close(fd[1]);
if (listener != -1) close(listener);
return -1;
}

main()
{
int sockets[2], child;
char buf[1024];

/* Get the socket pair */
if (__socketpair_tcp(sockets) < 0) {
printf("error %d on socketpair\n", errno);
exit(1);
}
BYTE socketSignal = IExec->AllocSignal(-1);
uint32 socketSignalMask = 1 << socketSignal;

printf("socketSignalMask = 0x%x\n", socketSignalMask);

ISocket->SocketBaseTags (SBTM_SETVAL(SBTC_SIGEVENTMASK), socketSignalMask, TAG_END);

/* write message to child */
if (write(sockets[1], DATA1, sizeof(DATA1)) < 0) {
printf("error %d writing socket\n", errno);
exit(1);
}

/* send message to parent */
if (write(sockets[0], DATA2, sizeof(DATA1)) < 0) {
printf("error %d writing socket\n", errno);
exit(1);
}

IExec->Wait(socketSignalMask);

/* get message from parent */
if (read(sockets[0], buf, sizeof(buf)) < 0) {
printf("error %d reading socket\n", errno);
exit(1);
}
printf("-->%s\n", buf);

IExec->FreeSignal (socketSignal);

/* finished */
close(sockets[0]);
close(sockets[1]);
}


(Note, that this is a test scenario, so don't get too hung up on the code actually making any practical sense. It is just the same thread reading and writing to/from the same socket pair.)


Edited by alfkil on 2010/11/8 18:55:39
Go to top


Re: Qt Native News
Just can't stay away
Just can't stay away


@kas1e

Quote:
Btw, did QtOpenGL module works in AmyCygnix setup ?

Nope. I don't think there is opengl for Amicygnix available anywhere. I tried compiling it just for fun, but ran into naming conflicts with graphics.library (Layer and Region as I remember).

A lot of Qt apps use the opengl module, so that is definetely high on my list to get it running.

Go to top


Re: Qt Native News
Just can't stay away
Just can't stay away


@mausle

Well, theoretically it might be possible, it should be possible for qmake to handle any kind of host/target system. I'm probably not going to try, though, since my skills with Windoze/linux are very limited.

Go to top


Re: Qt Native News
Just can't stay away
Just can't stay away


@kas1e

Quote:
Maybe still some help except testing we can do ?


For now just sit tight, and I will do an upload asap.

Go to top


Re: Qt Native News
Just can't stay away
Just can't stay away


News:

The event dispatcher in libQtCore is now running fully native with help gathered from the timer.device thread. Now all I need to do is sockets and processes, and I have a fully native Qt corelib. Yay!

Go to top


Re: Timer.device problem
Just can't stay away
Just can't stay away


@TSK & thomas

Thanks guys, that's a lot of great info right there . And sorry for being such a dumbass, these are still my very first steps with device programming.

@TSK

What exactly is the reason for using AllocSysObjectsTags intsead of
CreateIORequest? Is it smth with the type of memory allocated or...?

Go to top


Re: Timer.device problem
Just can't stay away
Just can't stay away


@salass00

Ahh... Thank you very much!

To justify my lack of knowledge, I can tell, that my source of information for the above code was "The programmers guide to the Amiga" from 1987...

Go to top


Timer.device problem
Just can't stay away
Just can't stay away


Hey guys,

what is wong with the following code?? I'm trying to make it wait for 10 seconds then print timeout and exit. Instead it just returns imidiately.

Quote:

#include <proto/exec.h>
#include <devices/timer.h>
#include <stdio.h>

int main (int argc, char **argv)
{
//open timer.device
struct MsgPort *timerPort = IExec->CreatePort (NULL, 0L);
uint32 timerSignalMask = (1 << timerPort->mp_SigBit);
struct TimeRequest *timerRequest = (struct TimeRequest *) IExec->CreateIORequest (timerPort, sizeof (struct TimeRequest));

IExec->OpenDevice (TIMERNAME, UNIT_MICROHZ, (struct IORequest *)timerRequest, 0L);

//set timeval and start IO
timerRequest->Time.Seconds = 10;
timerRequest->Time.Microseconds = 0;
IExec->SendIO ((struct IORequest *)timerRequest);

//await result
IExec->WaitPort (timerPort);
printf("timeout!\n");

//close timer.device
IExec->CloseDevice ((struct IORequest *)timerRequest);
IExec->DeleteIORequest ((struct IORequest *)timerRequest);
IExec->DeletePort (timerPort);

return (0);
}


Help!

EDIT: I have tried with BeginIO and DoIO as well, same result.

Go to top


Re: Qt Native News
Just can't stay away
Just can't stay away


@virgola

Quote:
(can you imagine going at the QT Developer Day showing off an Amiga?!?!?!?)


Well, technically you can already do that with the Amicygnix port if you want .

@all

Thanks for the encouragement

Go to top


Qt Native News
Just can't stay away
Just can't stay away


Here's the new repository:

http://sourceforge.net/projects/qtamigaosnative/

Current state of affairs is, that qmake has been built
(completely native) and I'm working on the rest of the command line tools (moc etc). Once this is done, I will continue to try and do a completely native version of libQtCore.so with no amicygnix utils and no glib. This should be "fairly simple".

Once all this is over, I can continue to the hard part, namely to do libQtGui.so. This is not going to be easy...

All help and encouragement is welcome!

Go to top


Re: New Qt SVN repository
Just can't stay away
Just can't stay away


@gregthecanuck

Quote:
Is there anything in 4.7 that makes its port easier than 4.6.2?


Nope, just more up to date.

Go to top


Re: New Qt SVN repository
Just can't stay away
Just can't stay away


@DAX

Yeah, I wonder also. But at least, I'm going to try .

Go to top



TopTop
« 1 ... 65 66 67 (68) 69 70 71 ... 78 »




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project