5,600 questions
3
votes
0
answers
61
views
LG webOS app not launching via DIAL protocol from Android — HTTP 201 but app stays stopped
I'm building an Android app that casts videos to an LG webOS TV app using the DIAL protocol. The DIAL request succeeds (HTTP 201) but the app never launches on the TV. When the app is already running, ...
Advice
0
votes
4
replies
198
views
What is an MCP server, and what core concepts should an entry-level developer understand?
I’m a beginner trying to understand what an MCP (Model Context Protocol) server is and how it is used in practice.
I’ve read that MCP is used to allow AI models to interact with external tools, data ...
1
vote
1
answer
79
views
Registering a protocol handler in Electron
As far as I’m aware, the old way of registering protocols has been deprecated.
In my code I have the following for an internal protocol:
// Before:
protocol.registerStringProtocol(
'doit',...
-2
votes
1
answer
74
views
Protocols and covariance - How to enable LSP in swift? [duplicate]
I want to keep some graph traversal algorithms as generic as possible and define a protocol for this purpose:
protocol Path {
var distance : Int { get}
var end : Node { get }
init (start:...
1
vote
0
answers
62
views
Generating a virtual image for an Electron application
I’m trying to replace a the content of an image URL with the result of a custom protocol. The idea is to get the data from a zip file.
The img element looks something like this:
<img src="...
2
votes
1
answer
450
views
Usage of { get set } in protocol causes "Couldn't look up symbols" error
I have been following this tutorial for learning swift programming, and up until the section on Protocols, it has been going flawlessly as per the tutorial. But once I reached the section on ...
1
vote
0
answers
208
views
Using the MELSEC Communication Protocol, Correct way to Read Multiple Data Register for Mitsubishi FX5UC-32MT/DSS-TS PLC
I'm working with a Mitsubishi FX5UC-32MT/DSS-TS PLC and trying to read data from multiple D registers using the MC protocol, specifically the 0406 command (QnA-compatible 3E frame for multiple-block ...
2
votes
1
answer
185
views
How to define a immutable ClassVar in a python protocol?
I have an Enum and several classes using that Enum in an immutable class variable.
from typing import ClassVar, Protocol, Final, Literal
from enum import Enum
class MyEnum(Enum):
A = 0
B = 1
...
0
votes
1
answer
185
views
How to use BAC0 to read from Bacnet.Room.Simulator
I installed Yabe (Yet Another BACnet Simulator) and Room.Control.Simulator with that. Now I want to write a Python program to read the temperature values. This is the first step to better understand ...
0
votes
1
answer
88
views
WaterRower S4 (Firmware 2.10) only responds to RESET – all other serial commands return ERROR
I’m trying to communicate with a WaterRower S4 Performance Monitor (firmware version 2.10) over USB, using standard serial communication.
The connection itself works, but I’m having trouble accessing ...
1
vote
1
answer
70
views
Conditional protocol extension and dependency handling
Let me start with example code I work with (simplified):
// Entity
struct NonEquatableEntity {}
struct EquatableEntity: Equatable {}
// Persistor
protocol Persistor {
associatedtype Entity
...
0
votes
1
answer
124
views
How to write an REQB function for ISO 14443 type B?
So the send_reqa is working fine but not clrc_reqb. The RF field is on but no card detection.
The chip is an clrc663 connected via spi to an nrf chip.
The registers and values are taken from NXP who ...
0
votes
1
answer
98
views
Ejabberd and XMPP
I don't know how to set up ejabberd on my Debian server for local development and testing as well as for learning purposes. I have a modem set up on my home without static IP address and using my old ...
1
vote
1
answer
69
views
What does "losing synchronization with the message stream" mean in application protocol, PostgreSQL?
I'm reading about how PostgreSQL (and similar network protocols) handle message parsing, and I found this statement:
To avoid losing synchronization with the message stream, both servers
and clients ...
2
votes
0
answers
90
views
Is it possible to specify a source port in libfabric's DRMA client side?
I'm working with libfabric and trying to specify a source port for my application. I've set up my fi_info structure and assigned the source address and port, but it doesn't seem to be working as ...
0
votes
0
answers
38
views
UDP User Protocol with 0 timeout recv() - Possible race condition?
I'm trying to debug a new issue that's cropped up in a new distro of our software. I've got a theory for what's going on, but I'd like to run it by people who know how UDP works.
We have a custom ...
0
votes
1
answer
103
views
How to make common private method with protocols?
Suppose I have the following code :
protocol Protocolable {
var data: Int { get }
func update()
}
class Dummy: Protocolable {
private(set) var data: Int = 0
func update() {
...
-1
votes
1
answer
62
views
Protocol inheritance/composition ignores shared base protocol
this example shows something that hindered me when doing stuff in our corporate code base (100kLoC w/ complicated inheritance, composition cases)
My problem is that swift won't accept classes as ...
0
votes
1
answer
60
views
Sec-WebSocket-Accept digest verification in the Client
Studying the WebSocket protocol a little bit and I am a little confused about the lack of mentioning any client verification of the digest that the server generates in Sec-WebSocket-Accept header.
...
0
votes
0
answers
228
views
Communication ProfiNet protocol and windows application
I use the S7 library to communicate with the PLC. When I try to read or write a single variable, at times, the system crashes. What is a better solution in this use for reading or writing a few ...
0
votes
1
answer
82
views
How to read leb128 from TcpStream in Rust
In short, I need to read a string from a TCP connection sent by a C# client. The client uses the BinaryWriter, which prefixes the actual string with a length in leb128 format. I'm using tokio::net::...
1
vote
0
answers
58
views
Error: "Type 'any View' cannot conform to 'View'" - With A Struct That contains a Protocol returning a View
I have a struct which contains a variable that conforms to a protocol that draws a View.
However when I go to use it, I get the following error:
Type 'any View' cannot conform to 'View'
I know I can ...
2
votes
2
answers
70
views
Swift Type Aliasing like C# possible?
I want to have the following types:
Renderable = Protocol/Interface with function render()
Bag<T> = Renderable, OrderedDictionary<String, T> where T = Renderable
Bag = Bag<Renderable&...
1
vote
1
answer
131
views
Calculating last byte in packet - reverse-engineering communication protocol for BLE device
I'm attempting to reverse-engineer the communication protocol used to send GIF images to an LED matrix connected via BLE.
It's a 20x96 LED matrix, for what it's worth, and here is the product link. It ...
2
votes
0
answers
301
views
How to make a payload in Edge TX and send it with ELRS telemetry package to flight controller (Betaflight, MSP)?
I want to practice Lua writing EdgeTX scripts for FPV drone telemetry. I have found a pretty decent documentation for edge tx and Lua. In order to accomplish my task I need to establish a ...
3
votes
1
answer
196
views
Is it possible to type check based on fitting __init__ signatures in Python?
Say i have a function, that makes an instance of incoming class.
def instantiate[T](class_: type[T], a: int, b: str) -> T:
return class_(a, b)
I want type checker to be able to say if a class ...
2
votes
1
answer
314
views
Guidelines on designing a TCP protocol for continuous stream of data
I have a continuous data stream over a TCP socket. I am in control over both server and client to implement a protocol. The basic requirement is that I can synchronize onto the stream of data. Ideally,...
0
votes
1
answer
153
views
Pay Now Button with upi:// Link in HTML Email is Not Clickable
I'm creating an HTML email template with a "Pay Now" button that links to a UPI payment URL. Here's the code for the button:
<a href="upi://pay?pa=example@oksbi&pn=John%20Doe&...
0
votes
0
answers
33
views
Why can I not use a protocol in Swift as a generic parameter which needs to conform to another protocol? [duplicate]
Simple example:
actor Storage<V: Hashable> {
let value: V
init(value: V) {
self.value = value
}
}
protocol Labelled: Hashable {
var label: String { get }
}
let ...
0
votes
1
answer
139
views
Type ‘any Target’ cannot conform to ‘Hashable’ in SwiftUI Picker
I’m working on a SwiftUI project where I have a Target protocol that conforms to Identifiable and Hashable. I have two structs, Silhouette and IPSC, that conform to this protocol. I want to display a ...
1
vote
0
answers
244
views
Register custom protocol handler in Firefox (open application from link in PDF)
I would like to open hyperlinks to an external application from a PDF inside Firefox, e.g:
zotero://select/library/items/3DKDWDRD
However, these links are not clickable from the PDF within Firefox (...
1
vote
1
answer
59
views
Karate-Gatling: requests with random id are not getting aggregated even if I set the protocol
I am doing the demo for Karate Gatling to see if it meets our needs for performance tests,
my test scenario is to create many transactions and check the transaction status, below are some of my ...
0
votes
1
answer
88
views
How can I inject generic data into a view controller?
I am trying to inject generic data into a View Controller using a generic parameter T. I have a protocol Coordinator which declares an associated type T and a data variable of type T. My ...
2
votes
4
answers
180
views
Decoding a Swift type which is only conditionally `Codable`
I have a Swift class that may or may not be Codable. When it is Codable, I would like to be able to load it from file. Here is a bare bones example...
protocol P {
func load()
}
final class A<...
0
votes
1
answer
82
views
SwiftUI using ForEach on generic Identifiable protocol causes LLDB RPC Server crash
In Xcode 16.0, I have created a protocol (which normally represents an enum) and am using that in another Identifiable protocol as the id. When I do use it in a ForEach loop, I get an error stating &...
0
votes
1
answer
74
views
Swift Execution Graph: Protocol + Generics Impasse
I'm trying to create a generic acyclic execution graph composed of nodes. Each node has 0 or more inputs and outputs. Each input and output is typed for a specific object type (Double, UIImage, String,...
0
votes
0
answers
79
views
How to make protocol compatible with bounded TypeVar
While creating stubs files, I ran into this problem
In this code (example), I need to make "SupportsPlaceholderValue" usable as a type argument to specify the return type of result
To ...
0
votes
1
answer
465
views
SDI-12 oscilloscope output explanation, STM32
I am trying to implement the SDI-12 protocol to my STM32L4 microcontroller using UART5 and a buffer (Check schematic, signal level conversion) from this module in a custom PCB in order to make my UART ...
0
votes
1
answer
108
views
Protocol conformance issue related to mocking and testing: Argument type 'AMock?' does not conform to expected type 'AProtocol'
I'm building a simple app to practice app architecture, working with protocols, associated types, etc. I think I'm using a pretty common pattern that I've used and seen many times before, however I'm ...
0
votes
0
answers
138
views
Snap7 and Modbus
I want to connect Python to PLC siemens. I have searched about snap7 and modbus but what is more popular when people use in project and what protocol is more stable?
I have tried both protocols and ...
0
votes
0
answers
18
views
Mark a method as "requires override" in Swift? [duplicate]
I want to have something like
class Parent {
@mustBeOverridden
func overrideThis(_ s: Source) -> Target {
// does not do anything, i.e. it is "abstract"
}
}
class Child1: ...
-1
votes
1
answer
111
views
Minecraft protocol modifying handshake
Currently working on a project and wondering how I can modify the Minecraft login handshake to change a players IP in the game. Essentially modifying what ip the server thinks the player is joining ...
1
vote
0
answers
212
views
Type 'any Shape' cannot conform to 'Shape'
I am trying to create different shapes on a card based on the card type in Swiftui.
import SwiftUI
let shapes: [any Shape] = [Circle(), Rectangle(), Ellipse()]
struct CardView: View {
var body: ...
0
votes
1
answer
184
views
XCode tests issue: 'any Protocol' does not conform to expected type 'Protocol' insert 'as! Protocol'
Started adding tests to supplementary objects
Tested class code:
class TokenAdapter {
private let tokenProvider: TokenProviderProtocol!
private let session: SessionProtocol!
// MARK: - Init
...
3
votes
1
answer
98k
views
Why the default implementation of foo.pb.go use global registry, can I modify it to avoid namesapce conflict?
From the official doc says. It will meet a namespace conflict if I have a single proto file and using it generated two pb in different pkg. For example, example.proto is generate into two example.pb....
0
votes
1
answer
515
views
Relative Import in Protobuf
Folder structure:
service.proto
syntax = "proto3";
package service;
option go_package = "../../../proto-generated/user/service";
import "user/models/models....
0
votes
1
answer
45
views
What are the steps to conform to the FieldRelationshipType protocol to use Field.Relationship in CoreStore?
Trying to learn CoreStore 9.2.0 with Swift 5.10
After compilation errors I have attempted to back my @Field.Relationship properties with the aliases and, at times, methods that are required to conform ...
1
vote
1
answer
88
views
Why am I unable to connect a webservice with tlsv1.2 protocol?
I need to access a web service using C# and so far everything has worked well. Recently they changed the security protocol to TLSV1.2 and so I can no longer access it with the following return:
...
2
votes
1
answer
2k
views
Use of protocol as a type must be written with any (Learning Purposes)
I've translated code from a functional programming language to Swift, and it works well when verifying via variables. However, I encounter an error when testing, attributed to Streamable and any ...
0
votes
1
answer
97
views
How can I speed up my Android Bluetooth reception?
Hardware
The Bluetooth device is powered by a chip called atmega32 and uses a bm78 Bluetooth chip.
The clock frequency of the MCU chip is 14.7456 MHz.
The baud rate of Bluetooth device is 115200.
The ...