Tag: 协议

UART寄存器未调试到终端

这是两个atmega328p控制器之间的UART传输。 我试图通过从接收控制器上的数据结构中打印变量来确认数据是否正确传递。 我的终端没有显示任何信息。 我只能确认从我的LED调用到达代码,我启用了portB。 我很确定我的BAUD率是正确的(51为8mhz)。 同时确信硬件正确连接。 有关如何进一步调试以找到问题的任何建议? 我是AVR开发的新手,所以也许对其他人来说很明显。 传递 #include #include typedef struct { uint8_t data; uint8_t timestamp; } tData; //Waits until bits are set to grab data char readChar() { while (! (UCSR0A & (1 << RXC0)) ); return UDR0; } //Waits until buffer is empty void writeChar(char data) { while(!(UCSR0A & (1<<UDRE0))); UDR0 […]

为什么我的服务器总是响应“没有证书”?

我正在尝试使用以下的SSL客户端/服务器示例: http : //simplestcodings.blogspot.com.br/2010/08/secure-server-client-using-openssl-in-c.html来创建安全连接使用SSLv3,但没有成功。 我更改了客户端以尝试在客户端加载证书,添加了服务器示例中存在的LoadCertificates函数。 我按照本教程创建了证书。 我的问题是,当我连接到服务器时,客户端可以看到有关服务器证书的信息,但服务器从不加载有关客户端证书的信息。 这是我的客户端代码: //SSL-Client.c #include #include #include #include #include #include #include #include #include #include #define FAIL -1 //Added the LoadCertificates how in the server-side makes. void LoadCertificates(SSL_CTX* ctx, char* CertFile, char* KeyFile) { /* set the local certificate from CertFile */ if ( SSL_CTX_use_certificate_file(ctx, CertFile, SSL_FILETYPE_PEM) <= 0 ) { […]