d->rtype = request_type_server_event;
+ /* stop processing server_events */
+ d->request_id = 0;
+
dump_outgoing_msg(&reply, ctx);
mrp_transport_senddata(d->ctx->t, &reply, TAG_ASM_TO_LIB);
break;
* resource present. If yes, tell the availability state changes
* through it. */
- /* TODO: check if the d->rset state has actually changed */
+ if (d->request_id == 0) {
+ /* We either haven't requested any resources or have
+ * given up the resources. Filter out events. */
+ break;
+ }
+
+ /* TODO: check if the d->rset state has actually changed -> only
+ * process server side notifications in that case */
if (mrp_get_resource_set_grant(d->rset))
reply.sound_command = ASM_COMMAND_PLAY;
if (ret <= 0 || ret == ASM_FILENAME_SIZE)
goto error;
- if (access(wr_filename, F_OK) < 0) {
- mrp_log_error("error accessing file created by ASM client library: %s",
- strerror(errno));
- goto error;
- }
-
mrp_log_info("writing client preemption to file %s", wr_filename);
wr_fd = open(wr_filename, O_NONBLOCK | O_WRONLY);
goto error;
}
- mrp_log_error("Wrote data 0x%08x successfully to client", data);
-
close(wr_fd);
return 0;