Skip to content

Commit 3bba1a5

Browse files
committed
import myconfig setting in cam_streamer
1 parent c209af1 commit 3bba1a5

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

app_httpd.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@
2828
#include "src/logo.h"
2929
#include "storage.h"
3030

31+
#if __has_include("myconfig.h")
32+
struct station { const char ssid[65]; const char password[65]; const bool dhcp;};
33+
#include "myconfig.h"
34+
#endif
35+
3136
#ifndef MIN_FRAME_TIME
32-
#warning "MIN_FRAME_TIME undefined, setting to default value of 500"
37+
#warning "MIN_FRAME_TIME undefined, using default value of 500"
3338
#define MIN_FRAME_TIME 500
3439
#endif
3540

cam_streamer.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@
1111

1212
#include "cam_streamer.h"
1313

14+
#if __has_include("myconfig.h")
15+
struct station {
16+
const char ssid[65];
17+
const char password[65];
18+
const bool dhcp;
19+
};
20+
#include "myconfig.h"
21+
#endif
22+
1423
#ifndef CAM_STREAMER_MAX_CLIENTS
15-
#warning "CAM_STREAMER_MAX_CLIENTS not defined, using default value of 10"
24+
#warning "CAM_STREAMER_MAX_CLIENTS undefined, using default value of 10"
1625
#define CAM_STREAMER_MAX_CLIENTS 10
1726
#endif
1827

@@ -131,8 +140,8 @@ void cam_streamer_task(void *p) {
131140
}
132141

133142
print_debug("[cam_streamer] fd %d dequeued\n", fd);
134-
135-
if(is_send_error(httpd_socket_send(s->server, fd, s->part_buf, s->part_len, 0))) {
143+
144+
if(is_send_error(httpd_socket_send(s->server, fd, s->part_buf, s->part_len, 0))) {
136145
cam_streamer_decrement_num_clients(s);
137146
continue;
138147
}

cam_streamer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typedef struct {
2424
size_t num_clients;
2525
} cam_streamer_t;
2626

27-
void cam_streamer_init(cam_streamer_t *s, httpd_handle_t server, uint16_t fps);
27+
void cam_streamer_init(cam_streamer_t *s, httpd_handle_t server, uint16_t frame_delay);
2828
void cam_streamer_set_frame_delay(cam_streamer_t *s, uint16_t frame_delay);
2929
void cam_streamer_task(void *p);
3030
void cam_streamer_start(cam_streamer_t *s);

myconfig.sample.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* just replace your ssid and password in the line below.
2323
*/
2424

25-
struct station stationList[] = {{"my_ssid","my_password", true}};
25+
const struct station stationList[] = {{"my_ssid","my_password", true}};
2626

2727
/*
2828
* You can extend the stationList[] above with additional SSID+Password pairs
@@ -148,6 +148,9 @@ struct station stationList[] = {{"ssid1", "pass1", true},
148148
// max_fps = 1000/min_frame_time
149149
// #define MIN_FRAME_TIME 500
150150

151+
// Maximum number of clients of the stream
152+
// #define CAM_STREAMER_MAX_CLIENTS 10
153+
151154
/*
152155
* Additional Features
153156
*

0 commit comments

Comments
 (0)